-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve the way components are given their attributes #14
Comments
10 tasks
filipdutescu
added a commit
that referenced
this issue
Apr 22, 2023
Add a `BaseComponent` which is tasked with adding all the base HTML attributes that each component should expose. It takes a tag, children and the base attributes. It also defines a new property, `attrs` which contains the extra attributes that a component should have defined. This includes non-standard ones, such as `data-*`. Add some [ARIA attributes][aria] to the base properties. Modify the `base_component_properties` to also implement `From<T>` for `BaseComponentProperties`, in order to make it easy to pass the default properties down to the `BaseComponent`. This is also implemented for a reference to `T`. This also updates all components and their examples. [aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes Fixes: #14 Signed-off-by: Filip Dutescu <filip@hucksy.dev>
filipdutescu
added a commit
that referenced
this issue
Apr 22, 2023
Add a `BaseComponent` which is tasked with adding all the base HTML attributes that each component should expose. It takes a tag, children and the base attributes. It also defines a new property, `attrs` which contains the extra attributes that a component should have defined. This includes non-standard ones, such as `data-*`. Add some [ARIA attributes][aria] to the base properties. Modify the `base_component_properties` to also implement `From<T>` for `BaseComponentProperties`, in order to make it easy to pass the default properties down to the `BaseComponent`. This is also implemented for a reference to `T`. This also updates all components and their examples. [aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes Fixes: #14 Signed-off-by: Filip Dutescu <filip@hucksy.dev>
filipdutescu
added a commit
that referenced
this issue
Apr 22, 2023
Add a `BaseComponent` which is tasked with adding all the base HTML attributes that each component should expose. It takes a tag, children and the base attributes. It also defines a new property, `attrs` which contains the extra attributes that a component should have defined. This includes non-standard ones, such as `data-*`. Add some [ARIA attributes][aria] to the base properties. Modify the `base_component_properties` to also implement `From<T>` for `BaseComponentProperties`, in order to make it easy to pass the default properties down to the `BaseComponent`. This is also implemented for a reference to `T`. This also updates all components and their examples. [aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes Fixes: #14 Signed-off-by: Filip Dutescu <filip@hucksy.dev>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Currently, each component needs to have its class, id and HTML event attributes manually set. This is firstly hard to maintain and secondly a pain to look at.
Proposal
Figure out a way to create an
html!
macro that does the same things asyew::html!
but adds the aforementioned attributes to the HTML tag.Other relevant information
Depends on yewstack/yew#1533 and/or yewstack/yew#2950
The text was updated successfully, but these errors were encountered: