Skip to content

Conversation

@s-cork
Copy link
Contributor

@s-cork s-cork commented Mar 27, 2025

This change is potentially breaking - but since we're still in beta that's probably ok and would recommend doing a minor version bump.

But also - feel free to close this issue if it's not a desired change
I like that it's consistent (you will always get a role on the outer component)
but i see the advantages of the current approach

we were missing role property on text input and menu button (https://anvil.works/forum/t/m3-legacy-read-only-role-not-working-with-m3-dependency/23911/5)
this PR implements the role prop in the same way we implement the visible prop
i.e. bypass our form template custom component descriptor and instead use the HtmlTemplate's role descriptor.

This will change where the .anvil-role-X class is applied, and so users may find their current role code breaks, and will need to change code from

.anvil-role-my-role {
    color: red;
}

to something like

.anvil-role-my-role .anvil-m3-some-class {
    color: red;
}
/* or  something like*/
.anvil-role-my-role button {
    color: red;
}

This might not be the approach we actually want to take
so feel free to close this, and instead we can just add the missing role properties to TextInput and MenuItem

close #279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dropdown_menu component is missing role property

2 participants