Skip to content

Commit

Permalink
fix(crepe): button type in toolbar (#1530)
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann authored Oct 8, 2024
1 parent f5b7d80 commit 6d36b40
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/crepe/src/feature/toolbar/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const toolbarComponent: Component<ToolbarProps> = ({

return html`<host>
<button
type="button"
class=${clsx('toolbar-item', ctx && isActive(strongSchema.type(ctx)) && 'active')}
onmousedown=${onClick((ctx) => {
const commands = ctx.get(commandsCtx)
Expand All @@ -61,6 +62,7 @@ export const toolbarComponent: Component<ToolbarProps> = ({
${config?.boldIcon?.() ?? boldIcon}
</button>
<button
type="button"
class=${clsx('toolbar-item', ctx && isActive(emphasisSchema.type(ctx)) && 'active')}
onmousedown=${onClick((ctx) => {
const commands = ctx.get(commandsCtx)
Expand All @@ -70,6 +72,7 @@ export const toolbarComponent: Component<ToolbarProps> = ({
${config?.italicIcon?.() ?? italicIcon}
</button>
<button
type="button"
class=${clsx('toolbar-item', ctx && isActive(strikethroughSchema.type(ctx)) && 'active')}
onmousedown=${onClick((ctx) => {
const commands = ctx.get(commandsCtx)
Expand All @@ -80,6 +83,7 @@ export const toolbarComponent: Component<ToolbarProps> = ({
</button>
<div class="divider"></div>
<button
type="button"
class=${clsx('toolbar-item', ctx && isActive(inlineCodeSchema.type(ctx)) && 'active')}
onmousedown=${onClick((ctx) => {
const commands = ctx.get(commandsCtx)
Expand All @@ -89,6 +93,7 @@ export const toolbarComponent: Component<ToolbarProps> = ({
${config?.codeIcon?.() ?? codeIcon}
</button>
<button
type="button"
class=${clsx('toolbar-item', ctx && isActive(linkSchema.type(ctx)) && 'active')}
onmousedown=${onClick((ctx) => {
const view = ctx.get(editorViewCtx)
Expand Down

0 comments on commit 6d36b40

Please sign in to comment.