Skip to content

Commit

Permalink
fix: don't submit buttons if Puck used in form
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmalyavkin authored Sep 3, 2024
1 parent 937bb92 commit f761e5f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/demo/app/custom-ui/[...puckPath]/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const Tabs = ({
return (
<button
key={idx}
type="button"
onClick={() => {
if (currentTab === idx) {
setCurrentTab(-1);
Expand Down
7 changes: 6 additions & 1 deletion packages/core/components/ActionBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export const Action = ({
label?: string;
onClick: (e: SyntheticEvent) => void;
}) => (
<button className={getClassName("action")} onClick={onClick} title={label}>
<button
type="button"
className={getClassName("action")}
onClick={onClick}
title={label}
>
{children}
</button>
);
Expand Down
1 change: 1 addition & 0 deletions packages/core/components/ComponentList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const ComponentList = ({
<div className={getClassName({ isExpanded: expanded })}>
{title && (
<button
type="button"
className={getClassName("title")}
onClick={() =>
setUi({
Expand Down
1 change: 1 addition & 0 deletions packages/core/components/ExternalInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const ExternalInput = ({
</button>
{value && (
<button
type="button"
className={getClassName("detachButton")}
onClick={() => {
onChange(null);
Expand Down
1 change: 1 addition & 0 deletions packages/core/components/LayerTree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const LayerTree = ({
>
<div className={getClassNameLayer("inner")}>
<button
type="button"
className={getClassNameLayer("clickable")}
onClick={() => {
if (isSelected) {
Expand Down
1 change: 1 addition & 0 deletions packages/core/components/SidebarSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const SidebarSection = ({
? breadcrumbs.map((breadcrumb, i) => (
<div key={i} className={getClassName("breadcrumb")}>
<button
type="button"
className={getClassName("breadcrumbLabel")}
onClick={() => setUi({ itemSelector: breadcrumb.selector })}
>
Expand Down

0 comments on commit f761e5f

Please sign in to comment.