Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(crepe): submits buttons in table and code block #1532

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/src/code-block/view/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const codeComponent: Component<CodeComponentProps> = ({
return html`<host class=${clsx(selected && 'selected')}>
<div class="tools">
<button
type="button"
ref=${triggerRef}
class="language-button"
onpointerdown=${onTogglePicker}
Expand Down
32 changes: 25 additions & 7 deletions packages/components/src/table-block/view/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const tableComponent: Component<TableComponentProps> = ({
onpointerleave=${pointerLeave}
>
<button
type="button"
data-show="false"
contenteditable="false"
draggable="true"
Expand All @@ -105,21 +106,30 @@ export const tableComponent: Component<TableComponentProps> = ({
class="button-group"
onpointermove=${(e: PointerEvent) => e.stopPropagation}
>
<button onpointerdown=${onAlign('left')}>
<button
type="button"
onpointerdown=${onAlign('left')}>
${config?.renderButton('align_col_left')}
</button>
<button onpointerdown=${onAlign('center')}>
<button
type="button"
onpointerdown=${onAlign('center')}>
${config?.renderButton('align_col_center')}
</button>
<button onpointerdown=${onAlign('right')}>
<button
type="button"
onpointerdown=${onAlign('right')}>
${config?.renderButton('align_col_right')}
</button>
<button onpointerdown=${deleteSelected}>
<button
type="button"
onpointerdown=${deleteSelected}>
${config?.renderButton('delete_col')}
</button>
</div>
</button>
<button
type="button"
data-show="false"
contenteditable="false"
draggable="true"
Expand All @@ -137,7 +147,9 @@ export const tableComponent: Component<TableComponentProps> = ({
class="button-group"
onpointermove=${(e: PointerEvent) => e.stopPropagation}
>
<button onpointerdown=${deleteSelected}>
<button
type="button"
onpointerdown=${deleteSelected}>
${config?.renderButton('delete_row')}
</button>
</div>
Expand All @@ -163,7 +175,10 @@ export const tableComponent: Component<TableComponentProps> = ({
onpointermove=${(e: PointerEvent) => e.stopPropagation}
ref=${xLineHandleRef}
>
<button onclick=${onAddRow} class="add-button">
<button
type="button"
onclick=${onAddRow}
class="add-button">
${config?.renderButton('add_row')}
</button>
</div>
Expand All @@ -176,7 +191,10 @@ export const tableComponent: Component<TableComponentProps> = ({
onpointermove=${(e: PointerEvent) => e.stopPropagation}
ref=${yLineHandleRef}
>
<button onclick=${onAddCol} class="add-button">
<button
type="button"
onclick=${onAddCol}
class="add-button">
${config?.renderButton('add_col')}
</button>
</div>
Expand Down