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
idfields to most of thePropertystructs of each component of the library and associated additions of theidfield into the html templates of the corresponding component.Example:
NOTE: The
idfield was already present forModals and was thus left untouched.The
idfield was added to each*Propsstruct below thepub classes: Option<String>field with#[prop_or_default]enabled on eachidaddition.Why so many
ids?My current legacy code that I am converting from Angular to Yew contains work that used
ids on components, which I expected to be able to use onybcelements. 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
ids in vanilla javascript, such as:is much easier to work with inlined javascript.
Finally,
idis 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 clippyandcargo fmton code.Cargo.tomlversionfield.CHANGELOG.md.