-
Notifications
You must be signed in to change notification settings - Fork 35
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
Feedback #95
Comments
@LeaVerou Thanks so much for your feedback! 🙏 This library was initially thought for me to avoid writing always the same thing, and an excellent sandbox to improve my JS skills, and for my students for a first approach on writing interactible web pages without writing JavaScript. Since your feedback, I've been focusing on improving the documentation, and I hope I've succeeded on this. About the API improvements, I think you're right on most of the suggestion. I will surely take care of more improvements and features. Still, I have some questions:
What did you have in mind mentioning Mutation Observers?
Did you mean give the user the possibility to automatically create a reusable named component?
Yes, it could be great to give the parent or ancestor selector missing in CSS, but I don't really know how to do that the right way. Although, it will be probably possible in the next few months… hopefully. Again, thanks very much for your feedback! |
Mutation observers can help you observe changes to the HTML, so your syntax can be reactive to changes, without user code needing to be tightly coupled to it. E.g. they change the value of an ETS attribute and you just pick up the change with no further action required
Yes, an actual custom element. E.g. |
As requested on Twitter. I’m opening an issue because Twitter is too painful for long form text.
My thoughts as I peruse the site, in no particular order:
I'm even more puzzled about how these work or why would I need them.
data-
part.data-toggle-trigger-off
works. "Add this attribute to an element inside a target to enable it to toggle the state of this target. For example, a close button inside a modal." — Show, don't tell! Include a demo!aria-hidden
is not changed according to which label is visible. Is this something ETS can do? If not, why? If so, this would be a good way to showcase it.aria-hidden
is toggled here. How does that work? Some text about this would be useful.focusable
attribute is not implemented in most browsers.Comments on attribute API
data-toggle-escape
is a bit too constrained. What aboutdata-toggle-key="Escape"
? You just useevt.key
in your JS, no need to have a dictionary of all possible key names.data-toggle-arrows
, e.g. what if you want other keys for navigation or only horizontal/vertical arrows? Maybedata-toggle-navigation="arrows"
ordata-toggle-navigation="horizontal arrows"
ordata-toggle-navigation="vertical arrows"
(also offers an extension point for other keys in the future).data-toggle-event
ismouseover
anddata-toggle-escape
is specified?data-toggle-target
relative to the current element, to avoid having to generate ids for repeated elements. Perhaps by the selector using&
or:scope
to represent the current element?data-toggle-target-next
to optionally accept a value to define what the "next" element is, when it's not the next sibling.data-toggle-class
by itself? Might be a good default to assume the target is the current element itself. Wait, this is how it works, based on the checkbox element. Something to document then!Overall, I think this is a nice library that could be useful for developing a variety of interactions without writing JS, but the documentation needs a lot of work to be user-friendly.
The text was updated successfully, but these errors were encountered: