Skip to content

Commit

Permalink
fix(crepe): submits buttons in table and code block (#1532)
Browse files Browse the repository at this point in the history
* fix(crepe): submits buttons in table and code block

* chore: fix formatting

* chore: fix formatting
  • Loading branch information
TorstenDittmann authored Oct 14, 2024
1 parent 6d36b40 commit ccda9d8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
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

0 comments on commit ccda9d8

Please sign in to comment.