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.
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
fix: Make the entire advanced mode toggle container clickable #7761
fix: Make the entire advanced mode toggle container clickable #7761
Changes from 1 commit
fbaace5
d9f2503
152b3dc
580bc20
9961c9d
debca26
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think we should make the Container clickable
@Devessier what's your recommendation here ? use a button?
I feel the "Advanced" is actually a label for the toggle
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.
Thanks for mentioning me, @charlesBochet.
Indeed, I think we should make the text "Advanced:" a true HTML
<label>
element. I don't believe the whole container should be clickable, as clicking on a blank space would update the toggle, which might seem strange.The issue is that the
<Toggle />
component is only made of<div>
and not a proper<input>
element, so using a<label>
would do nothing. I had this component on my list of accessibility things to discuss.See https://github.com/twentyhq/twenty/blob/05e8f8a0b1fd4c0b1e53c289baba3d073565b61a/packages/twenty-front/src/modules/ui/input/components/Toggle.tsx
What do you think we should do? I'm happy to discuss short-term/mid-term solutions.
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.
@Vardhaman619 could you update our Toggle component to include a
Take inspiration from chakra ui regarding the html structure
It looks to me that they have an invisible input
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.
Please note that the styles applied to hide the
input
are to make it visible only for screen readers (the tool used by people with disabilities to visit websites).These styles are now normalized and everybody uses the same to hide an element for people not using a screen reader:
Some resources :
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.
We can introduce a component in this case, let's put it in an accessibility folder in twenty-ui
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.
Chakra UI has two components : VisibilityHidden and VisibilityHiddenInput. (https://v2.chakra-ui.com/docs/components/visually-hidden/usage#visually-hidden-input)
Their VisibilityHidden component renders a
<span>
as it's usually used to provide little indications to the users, like a hidden label explaining what shows an icon.