Comments (3)
My knee jerk reaction to this is, it's not reasonable for us to try to support this at present. I've spent a ton of time getting form control submission, constraint validation, and form*
attributes to work to mimic the platform. To achieve this, we would need to attach mutation observers to each fieldset from every form control. This can get expensive, especially in larger forms.
In fact, looking at the ElementInternals API, I don't immediately see any way to do this even after we switch over. I was curious if this happened automatically — although I wouldn't expect it to — and it doesn't.
https://codepen.io/claviska/pen/mdgewem?editors=1010
This is going to be a wontfix until there's a way to do it without attaching a mutation observer.
from shoelace.
My knee jerk reaction to this is, it's not reasonable ... [snip] ... To achieve this, we would need to attach mutation observers to each fieldset from every form control. This can get expensive, especially in larger forms.
Yeah, I can see how that's not desirable, and the necessary workarounds to preserve any performance do feel pretty unreasonable.
In fact, looking at the ElementInternals API, I don't immediately see any way to do this even after we switch over. I was curious if this happened automatically — although I wouldn't expect it to — and it doesn't.
That's not quite accurate, there is a formDisabledCallback(isDisabled)
callback for formAssociated
custom elements. See my fork of your codepen here: https://codepen.io/grncdr-the-bashful/pen/XWQmzyX
I think it would be worth revisiting this when Shoelace moves to using ElementInternals and formAssociated
(#1706).
from shoelace.
Oh, nice! I missed that in the MDN docs. Thanks for the heads up!
from shoelace.
Related Issues (20)
- sl-select does not close when clicking outside HOT 2
- 2.13.0 automatically installs `playwright` when used as a dependency HOT 6
- <sl-tooltip> adds a space when used inline HOT 2
- [v2.13.0] sl-select component shows HTML source code when selecting an option containing HTML HOT 1
- Type Error: Illegal Constructor thrown at runtime when instantiating Shoelace components by constructor HOT 2
- Checkbox Component: Coloring mandatory field indication ("*")
- Strange behaviour with SlSelect in a Drawer or a Dialog : it triggers parent event SlHide and SlShow
- Carousel pagination not synced with active item when prefer-reduced-motion HOT 3
- Tab components breaking after mounting HOT 2
- sl-checkbox with no value attribute has value of 'undefined' when checked HOT 3
- Misalignment of some components HOT 1
- sl-dialog causes layout shift as of 2.13 HOT 2
- sl-checkbox has no applied styles for the help-text HOT 1
- Placeholder text overflows in sl-input component HOT 1
- Dialogs in Safari can lose focus indication when "Open Dialog" button clicked rather than tabbed to and Enter HOT 2
- Light theme triggers Flash of Unstyled Content
- Cannot set up / run according to README.
- Select test fails with timeout in Firefox HOT 3
- tree-item rendering "null" when expand-icon is used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shoelace.