-
Notifications
You must be signed in to change notification settings - Fork 90
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
fix(NcCheckboxRadioSwitch): only bind aria attributes to the input #5777
Conversation
34329dd
to
7fcff63
Compare
I am not sure here, this is not what I would expect, I use a checkbox component. So the only thing I can expect is that the component is a checkbox. Instead I think the tests on server are broken by design, they assume some internal component layout that is not guaranteed. It is not guaranteed that So instead you should probably use |
The tests itself could have been written differently, but this is not really the issue here. The tests failure just made us notice this change. We are touching a different dilemma about what we expect. That's why in the past we always declared aria variable as props, so that we can see all the attributes that are forwarded to the background, and document them. |
Even if that was the case, this change should not have been a minor nor a patch. Whatever decision taken prior, even if less than ideal, should stay consistent :) Anyway, let's move forward, while I think and would like us to be more careful in the future, I think we can indeed adjust and only keep data attributes on the outer layer. I'm too deep into other areas to notice potential missed pitfalls. As this is your code @susnux, i'll let you take the decision. |
7fcff63
to
5a84712
Compare
It is because that it internal, for components the structure is private like for classes private methods or properties. class Foo {
_private: 'foo'
} to class Foo {
#private: 'foo'
} Same problem we have with class names because we do not use two way scoping, people use internal class names of components which is dangerous as that is nothing public. Meaning even accessing To sum it up, what I want to say: If you have the possibility to make tests less fragile, we should do it. |
I agree with any internal structure, it's subject to change and it's fine. This is not what it is about here. We're preventing any dev applying standard html attributes to a component now. We're not talking about anything private or public, we're literally stripping away the very core of a component rendering, controlling the outer layer. What if I want to add some styling to the component, will it be applied to the input now? EDIT: answering my own question, |
@skjnldsv no it is not for Vue2 |
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
5a84712
to
79e37a2
Compare
@skjnldsv Pushed a test to ensure attributes like class and style are correctly set. |
…lass and style are correctly set Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
79e37a2
to
083cd8f
Compare
Fix regression from #5507
Needed for:
@nextcloud/vue
to 8.13.0 nextcloud/server#46292