Skip to content
Merged
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
13 changes: 6 additions & 7 deletions apps/builder/app/canvas/interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,12 @@ const switchPageAndUpdateSystem = (href: string, formData?: FormData) => {

export const subscribeInterceptedEvents = () => {
const handleClick = (event: MouseEvent) => {
// Prevent forwarding the click event on an input element when the associated label has a "for" attribute
if (
event.target instanceof Element &&
event.target.closest("label[for]") &&
!$isPreviewMode.get()
) {
event.preventDefault();
if (event.target instanceof Element && !$isPreviewMode.get()) {
// Prevent forwarding the click event on an input element when the associated label has a "for" attribute
// and prevent checkbox or radio inputs changing when clicked
if (event.target.closest("label[for]") || event.target.closest("input")) {
event.preventDefault();
}
}

if (
Expand Down