Giter Site home page Giter Site logo

Comments (3)

claviska avatar claviska commented on May 17, 2024

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.

grncdr avatar grncdr commented on May 17, 2024

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.

claviska avatar claviska commented on May 17, 2024

Oh, nice! I missed that in the MDN docs. Thanks for the heads up!

from shoelace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.