Skip to content

Replace fieldsets with divs. #109

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

Merged
merged 1 commit into from
Nov 4, 2023

Conversation

willnationsdev
Copy link
Contributor

Closes #108. There are now no more mentions of "fieldset" within the codebase except for a TODO in ToggleGroup.svelte.

Note that I had a large number of warnings/errors in my VS Code project, but everything built (and seemed to behave) just fine. May have just misconfigured something on my end, idk.

  1. Gave the new <div> elements a "group" role.
  2. Identified each element/component supporting disabled and made sure to pass the parent component's state to it since the <fieldset> previously would've affected nested form fields' disabled state automatically.
    • The Input component did not have a disabled property, so I had to add one.

If I missed anything, please feel free to let me know (or just fix w/ a follow-up).

Copy link

vercel bot commented Nov 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-ux ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 4, 2023 3:29am

Copy link

what-the-diff bot commented Nov 4, 2023

PR Summary

  • Changed container types in Field and TextField components
    The container element type has been changed from <fieldset> to <div> in Field.svelte and TextField.svelte. This might help to make the styles and behaviors more consistent across different browsers.

  • Added 'disabled' property to Button component
    A new disabled property has been added to the <Button> element in Field.svelte and TextField.svelte. This will allow users to disable these buttons when required, providing better interaction control in our interface.

  • Renamed slot in MenuField component
    The slot "fieldset" has been renamed to "root" in MenuField.svelte. This could improve code readability and clarity.

  • Enhanced TextField component with 'disabled' property
    The disabled property has been added to various elements within TextField.svelte. This gives additional control over the interaction with these elements, contributing to a more intuitive user experience.

@techniq
Copy link
Owner

techniq commented Nov 4, 2023

@willnationsdev Thanks! Now that you mention it, I think disabled was maybe another reason I used fieldset. In some cases, I'll add pointer-events-none on the container to make sure nothing is clickable in the disabled state, but I like passing disabled down in this case, especially since that's how it worked (inherently).

I gave it a run through and everything looked unchanged. Thanks again!

@techniq techniq merged commit bb9ab3d into techniq:master Nov 4, 2023
@willnationsdev willnationsdev deleted the fieldset-to-div branch November 4, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent forced use of <fieldset> for individual fields.
2 participants