ENG-1635: Change key image setting from checkbox to toggle switch#1121
ENG-1635: Change key image setting from checkbox to toggle switch#1121sid597 wants to merge 1 commit into
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
| if (!disabled) onChange(!value); | ||
| }} | ||
| > | ||
| <input type="checkbox" checked={!!value} disabled={disabled} /> |
There was a problem hiding this comment.
🟡 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.
| <input type="checkbox" checked={!!value} disabled={disabled} /> | |
| <input type="checkbox" checked={!!value} readOnly disabled={disabled} /> | |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Key image (first image from file)setting in Obsidian node type settings from a plain checkbox to the Obsidian-native toggle switch, matching core Obsidian behaviorcheckbox-container/is-enabledpattern as the existing toggles inGeneralSettings,AdminPanelSettings, andRelationshipSectiondisabledbehavior for imported node typesTest plan
npx eslint --max-warnings 0(only pre-existing warning, same as main)npx prettier --checknpx tsc --noEmit --skipLibCheck(only pre-existingpackages/databaseerrors, same as main)