Skip to content
Open
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
14 changes: 8 additions & 6 deletions apps/obsidian/src/components/NodeTypeSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ const BooleanField = ({
onChange: (value: boolean) => void;
disabled?: boolean;
}) => (
<input
type="checkbox"
checked={!!value}
onChange={(e) => onChange((e.target as HTMLInputElement).checked)}
disabled={disabled}
/>
<div
className={`checkbox-container ${value ? "is-enabled" : ""}`}
onClick={() => {
if (!disabled) onChange(!value);
}}
>
<input type="checkbox" checked={!!value} disabled={disabled} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Controlled checkbox missing readOnly prop causes React console warning

The <input type="checkbox" checked={!!value} /> at line 166 is a controlled React input (it has checked prop) but lacks both onChange and readOnly. React will emit a console warning: "You provided a checked prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultChecked. Otherwise, set either onChange or readOnly."

The existing pattern in RelationshipSection.tsx:615 correctly adds readOnly to suppress this warning. The fix is to add readOnly to the input element.

Suggested change
<input type="checkbox" checked={!!value} disabled={disabled} />
<input type="checkbox" checked={!!value} readOnly disabled={disabled} />
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

</div>
);

const TextField = ({
Expand Down