-
Notifications
You must be signed in to change notification settings - Fork 29
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
Behaviour of value attribute #122
Comments
@raxell riot/riot#1453 is an issue referring to an old Riot.js version 2015. This repository is brand new created explicitly for Riot.js 4. Unit test behave consistently with the new documentation. Regarding the value attributes on non form attribute we could probably handle them differently here but it would mean also adding more magic to the source code generating probably more problems than the ones we are supposed to solve |
Oh you're right, I thought the latest comments of april was about v4. So |
I will migrate this issue to the compiler. We would need to patch the dom-nodes first to list all the input nodes. |
More than the inputs elements the ones that must use the value expression binding are those that have |
The patch seems wrong to me, the problem with |
could you please make a PR on the dom-nodes repo? I have now prepared the hooks in the compiler. |
The list can be found here, |
Droppint the support of the |
List of the additional elements having the
I honestly I don't get either what's the problem with the I think I am going to list all of them and close this issue that for me is only related to html tags that don't allow the use of the |
Just a sec, if you continue to make changes I'll never end to rebase ahahah |
the point is: why should I handle differently DOM elements that allow the use of the |
Cause having the attribute and setting the value with |
The thing is <progress max="10" value="{progressValue}"></progress> Here if the value is binded using a value expression the removal of the attribute can only be made by manipulaiting the dom by hand. If it would be binded using a normal attribute expression passing a falsy value would remove the value attr making progress indeterminate (loading animation). |
thank you for your example. I still don't understand which kind of problem we are trying to solve. |
No, "If there is no value attribute, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it is expected to take". If you look at the example, the first progress bar starts with an indeterminate state (like "still don't know how much time it will take"), while the second is just initialized at 0%, those are two different things.
Doesn't make sense, will not set any text in the textarea. To me the problem seems clear, I don't know if I'm wrong with something, is there anyone else that can review this and say if it make sense? |
Sidenote: it's not necessary to remove |
* master: fixed: eslint warning 4.3.6 updated: changelog closes #122 closes #122 added: test for #121 added: other tests fix: Chained object access as text expression fixes riot/riot#2737 4.3.5 updated: fix css unicode properties 4.3.4 updated: changelog updated: attempt to fix riot/riot#2714 4.3.3 added: changelog
The value attribute has an ad hoc expression since it is not recomended to set it with
setAttribute
.But the behaviour of value is different from that of normal attributes, when passing a falsy expression the attribute is not removed. This can be a problem when using it on non-form elements (example).
Is this the expected behaviour?
There are conflicting informations about falsy values, here it is said that falsy values do not remove attributes, but the tests checks for the opposite:
https://github.com/riot/dom-bindings/blob/9697d1fb7429c3a0b494c0ee6b472b470a054434/test/expressions/attribute.spec.js#L33-L45
The text was updated successfully, but these errors were encountered: