-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Failing Test] {{on}} modifier removes valueless attributes #18480
base: main
Are you sure you want to change the base?
Conversation
interestingly, the `readonly` assertion passes, while all the others fail
This appears to occur with any modifier except |
We can fix it with an AST transform until we finish the upgrade, which can also be backported to LTS |
VM upgrade is finished... |
seems the same as #18712 |
Can you confirm that this is not about boolean attributes, but is actually about valueless attributes (which are often boolean, 😸)? |
Would adding a video element with a controls attribute to the test confirm this? I didn't realize there was a distinction. |
also add assertion for video element
@kturney ya, any attribute would do, even something like |
@rwjblue I added a video element with a controls attribute to the test. |
Is this still relevant? |
Noticed today that using the {{on}} modifier on an element with the
required
attribute removed the attribute.e.g.
template:
<input type='text' required {{on 'input' this.onInput}} >
resulted in
DOM:
<input type='text' >
However, adding a value to the attribute caused it to remain.
e.g.
template:
<input type='text' required='true' {{on 'input' this.onInput}} >
resulted in DOM
DOM:
<input type='text' required >
While adding a failing test for
required
, I also added checks for other boolean attributes.autofocus
,required
, anddisabled
are all removed, whilereadonly
is preserved.I believe the problem is with the {{on}} modifier because
template:
<input type='text' required >
results in
DOM:
<input type='text' required >
.I looked through the {{on}} modifier source and nothing jumped out at me, so maybe it isn't directly an {{on}} problem though?
Side Note:
I made the
disabled
element abutton
to show that it is not onlyinput
that is affected.