Comments (3)
Hey @danyball, thanks for filing this issue and glad to hear you've been making use of our support for form-associated custom elements!
I just want to check a little bit to make sure I'm understanding the ask here. Right now Stencil and the form-associated custom elements standard interact in a bit of an undesirable way, where if you set a disabled
prop that will be added to the element as an attribute, and since for form controls the disabled state is based on whether or not the attribute is present, rather than its value, this results in the form control being disabled whether disabled
is set to true
or false
.
If I've understood that correctly, the request is then to change Stencil's behavior from something like:
flowchart LR
A[Stencil component has 'disabled' prop] --> B[set disabled attr on element to prop value]
to something like this:
flowchart TD
A[Stencil component has 'disabled' prop]
B[Is component form-associated?]
C[set disabled attr on element to prop value]
D[What's the value for `disabled`?]
E[Remove `disabled` attr from element]
A ---> B
B --->|yes| D
B --->|no| C
D --->|true| C
D --->|false| E
If I have that all right, then there's a few things to say about this. One is that if we applied this across the board it would be a breaking change, since we'd be changing the behavior of Stencil components where other developers might be depending on the current behavior. On the other hand, we could make this an opt-in change with a plan to make it the default in a future breaking change. Curious to hear your thoughts!
from stencil.
Related Issues (20)
- bug: Required props in composed components test fails to parse kebab-cased prop HOT 5
- bug: `hidden` attribute initially ignored on children in non-shadow slot HOT 1
- bug: Compiled Storybook does not work (cannot find /assets/xyz.entry.js) HOT 1
- bug: custom docs-readme directory HOT 7
- bug: `stencil build` command generates the folder `dist\esm\polyfills\` folder even if buildEs5=false in config HOT 2
- bug: Dependency mismatch with certain libraries when hydrate output target HOT 4
- Error: The glob pattern import("./**/*.entry.js*") did not match any files [empty-glob]bug: HOT 26
- bug: NotSupportedError Failed to construct 'CustomElement': The result must not have attributes HOT 3
- bug: cloneNodeFix not working with experimentalSlotFixes flag HOT 4
- Nested Slots render children components in the wrong order if children components are added dynamically at run time. HOT 5
- bug: jeep-sqlite broken by version 4.12.2 HOT 3
- [Tracking] WebdriverIO Migration HOT 2
- bug: `emulate.userAgent` is not used in E2E Screenshot tests HOT 1
- feat: create a 'web-types' doc output target HOT 1
- bug: stencil build throws errors from node_modules HOT 4
- bug: hydrate app | unhandledRejection TypeError: Cannot read properties of undefined (reading 'nextTick') HOT 5
- bug: stencil build causes copyfile error and creates extra directory in monorepo HOT 2
- bug: Unable to run Angular test app outside monorepo and import Stencil component successfully HOT 11
- bug: Stencil Components: Nested Slots insert new children before last child if children components are added dynamically at run time. HOT 2
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 stencil.