-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add more title options #79
Conversation
First PR so wanted to keep it light :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to merge this.
Couple of comments & since we're adding tests again, it would be good to run them on CI, have a look at https://github.com/alpine-collective/alpinejs-devtools/blob/master/.github/workflows/build.yml#L27
Also remembered that we've got a note about this in the README that we should probably update. |
This PR adds a couple more ways to discover a component's title.
Some of these might not fit given they are not standard, but I feel they offer flexibility. I can remove them if no one agrees.
x-title
- Let's the user override the title and not have it affect anything else.x-id
- Used in the$component
helper so if it exists, the user has intended it to be an identifieraria-label
- Accessibility label so better thanrole
This also pushes
role
belowx-data
(if a function name) asrole
is usually pretty generic, while a function name is often a better identifier. Objections?I also added a unit test to check the naming. Visual test passed too.
Not sure how to test the Livewire portion though, or if we event want to.