Adding id
fields to most components.
#10
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds
id
fields to most of theProperty
structs of each component of the library and associated additions of theid
field into the html templates of the corresponding component.Example:
NOTE: The
id
field was already present forModal
s and was thus left untouched.The
id
field was added to each*Props
struct below thepub classes: Option<String>
field with#[prop_or_default]
enabled on eachid
addition.Why so many
id
s?My current legacy code that I am converting from Angular to Yew contains work that used
id
s on components, which I expected to be able to use onybc
elements. I felt it would be beneficial to add the field across the library in a standardized way for those who expect the html attribute to be present.As well, using
id
s in vanilla javascript, such as:is much easier to work with inlined javascript.
Finally,
id
is also a part of the global attributes defined on all html elements per the HTML Living Standard and I felt it was appropriate to define the attribute as common on all components in this library.Contribution Checklist
cargo clippy
andcargo fmt
on code.Cargo.toml
version
field.CHANGELOG.md
.