How to solve tabindex etc deprecations?
RobbieTheWagner opened this issue · 11 comments
Now that ember-bootstrap has deprecated <el.control @tabindex="1">
in favor of passing the raw HTML attribute tabindex
, deprecations are thrown when using this addon. It does not seem to be possible to remove the @
because the arg needs to be passed into power-select. Any advice on getting around these deprecations? Will this addon be updated to support the same syntax as ember-bootstrap?
Are you using the latest release (2.0) of this addon? #89 applies ...attributes
to the power-select component, so if power-select itself applies the attributes correctly, I would expect it to work!?
@simonihmig power select does not apply the attributes though, is what I suppose I am getting at. They have to be passed as arguments for power select to apply them.
There is an ...attributes
in power select, but I don't think it does what we think https://github.com/cibernox/ember-power-select/blob/v3.0.6/addon/templates/components/power-select.hbs#L16
tabindex
has a separate value set here https://github.com/cibernox/ember-power-select/blob/v3.0.6/addon/templates/components/power-select.hbs#L32
And the same with disabled
https://github.com/cibernox/ember-power-select/blob/v3.0.6/addon/templates/components/power-select.hbs#L12
I think we are going to have to allow @
for attributes when the controlType
is power-select
or they are not going to be applied.
cc @jelhan
@rwwagner90 are you sure that <el.control @tabindex="1">
does trigger a deprecation?
<form.element @type="power-select" @tabindex="1">
should, but IIRC the yielded el.control
should actually not (for internal reasons).
Haven't considered that some plugins may need that arguments to be honest. But at least for Power Select that is hopefully fixed upstream soon. The limitation is tracked in this issue cibernox/ember-power-select#1203 and a pull request is provided in cibernox/ember-power-select#1331. I would ignore the deprecation until that landed.
@simonihmig I think we should make sure that using HTML attributes is supported by Power Select before releasing v4
.
Edit: Added a chapter to track that potential release blockers in the roadmap issue (ember-bootstrap/ember-bootstrap#957).
same issue with @placeholder
@jelhan I think my recommendation would be to update this addon to pass through the attributes as if they were arguments. Then we could enforce passing them as attributes to this addon, and it would change them back to args. So internally you would, I think, have to do something like this to pass to power-select:
I'm not totally sure if you can access attributes like that or not though.
As far as I know the attributes passed in with angle bracket invocation couldn't be accessed from within a component.
@jelhan so ..attributes
is the only way to use them? If so, we probably need to make this addon not require everything to be attributes.
@jelhan so
..attributes
is the only way to use them? If so, we probably need to make this addon not require everything to be attributes.
As far as I'm aware: yes.
I think this has been fixed upstream. Please let me know if it is still an issue.