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: add type "button" on components buttons to avoid send form #112

Merged
merged 9 commits into from
Aug 26, 2023
1 change: 1 addition & 0 deletions ui/editor/components/bubble-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const EditorBubbleMenu: FC<EditorBubbleMenuProps> = (props) => {
key={index}
onClick={item.command}
className="p-2 text-stone-600 hover:bg-stone-100 active:bg-stone-200"
type="button"
>
<item.icon
className={cn("h-4 w-4", {
Expand Down
2 changes: 2 additions & 0 deletions ui/editor/components/color-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const ColorSelector: FC<ColorSelectorProps> = ({
setIsOpen(false);
}}
className="flex items-center justify-between rounded-sm px-2 py-1 text-sm text-stone-600 hover:bg-stone-100"
type="button"
>
<div className="flex items-center space-x-2">
<div
Expand Down Expand Up @@ -169,6 +170,7 @@ export const ColorSelector: FC<ColorSelectorProps> = ({
setIsOpen(false);
}}
className="flex items-center justify-between rounded-sm px-2 py-1 text-sm text-stone-600 hover:bg-stone-100"
type="button"
>
<div className="flex items-center space-x-2">
<div
Expand Down
2 changes: 2 additions & 0 deletions ui/editor/components/link-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const LinkSelector: FC<LinkSelectorProps> = ({
return (
<div className="relative">
<button
type="button"
className="flex h-full items-center space-x-2 px-3 py-1.5 text-sm font-medium text-stone-600 hover:bg-stone-100 active:bg-stone-200"
onClick={() => {
setIsOpen(!isOpen);
Expand Down Expand Up @@ -58,6 +59,7 @@ export const LinkSelector: FC<LinkSelectorProps> = ({
/>
{editor.getAttributes("link").href ? (
<button
type="button"
className="flex items-center rounded-sm p-1 text-red-600 transition-all hover:bg-red-100 dark:hover:bg-red-800"
onClick={() => {
editor.chain().focus().unsetLink().run();
Expand Down
1 change: 1 addition & 0 deletions ui/editor/components/node-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const NodeSelector: FC<NodeSelectorProps> = ({
setIsOpen(false);
}}
className="flex items-center justify-between rounded-sm px-2 py-1 text-sm text-stone-600 hover:bg-stone-100"
type="button"
>
<div className="flex items-center space-x-2">
<div className="rounded-sm border border-stone-200 p-1">
Expand Down