Comments (6)
Hello @raycohen 😃
I am also running into the same issue in my applications, and I find it more less than ideal and, more like a workaround to be adding data-* attributes to the parent and referring the child element(i.e. radio-button).
I'll be happy to send a PR for adding this enhancement. I was thinking of adding a new property, say dataAttributes
which accepts an hash of data-* key/value pairs, which gets added to the radio buttons' dom - just like the other attributes that is being done currently, like ariaLabelledby
, tabindex
, etc
from ember-radio-button.
What would really be nice is if the components supported attribute forwarding (AKA splattributes, ...attributes
in the template).
Depending on the Ember version support matrix and the tolerance for either providing or requiring a polyfill, that would allow you to add whatever attribute you want to a <RadioButton />
component and have the attributes passed along to the underlying input
.
from ember-radio-button.
We don't currently have a good way to support data-test
attributes directly on the input element. I would recommend putting a data-test attribute on an ancestor and then using something like [data-test-my-ancestor] input[type=radio]
from ember-radio-button.
I would love to see support for data-*
attributes on this!
from ember-radio-button.
What would really be nice is if the components supported attribute forwarding (AKA splattributes,
...attributes
in the template).Depending on the Ember version support matrix and the tolerance for either providing or requiring a polyfill, that would allow you to add whatever attribute you want to a
<RadioButton />
component and have the attributes passed along to the underlyinginput
.
Hmm know any addons that use this kind of polyfill? I'm running into this and would like to submit a PR.
I'd try out a local workaround, but it doesn't sound like this is extensible.
Never mind — if you're using modern Ember (support splattributes), you can generate a component override for radio-button.js/.hbs. You'll need to copy over the template from the addon and insert the attribute spread in the label:
Nevertheless, we should build out support :)
from ember-radio-button.
Any progress on this? Seems it's not possible to apply a modifier to the radio button
from ember-radio-button.
Related Issues (20)
- make keyboard navigable according to WCAG-A
- DEPRECATION: `hasBlock` is deprecated. Use `has-block` instead. HOT 4
- Where is Version 3 for Ember. 3.16? on EmberObserver? HOT 6
- Trying to upgrade to newer version
- multiple depreciations detected in 2.0.1
- `aria-checked` not being set on `master` branch HOT 3
- Changes on master have not yet been released HOT 22
- groupValue Documentation a bit confusing HOT 1
- Error: You cannot use `attributeBindings` on a tag-less component HOT 4
- <input> field isn't including a correct "value" attribute in the DOM in IE11
- autofocus attribute not supported HOT 1
- groupValue not updated on button deselect HOT 6
- Allow specifying a label using inline invocation HOT 3
- CRUD : Edit does not retain previous value HOT 2
- Upgrade ember-cli-htmlbars to remove deprecation warning HOT 3
- Question: What is this syntax in render of a test HOT 3
- aria-checked not used?
- Replace sendAction with closure actions HOT 10
- Remove `labeled-radio-button`
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 ember-radio-button.