-
Notifications
You must be signed in to change notification settings - Fork 2
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
New DTI Website: Use Details/Summary For FAQ Accordion #746
Conversation
[diff-counting] Significant lines: 46. |
new-dti-website/src/app/globals.css
Outdated
} | ||
|
||
details { | ||
user-select: none; |
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.
Clicking on the accordian a few times in a row leads to some of the summary text getting highlighted, which is a regression from previous behavior. So I made the details not selectable.
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.
hmmm...
i'm usually wary of using user-select: none;
because it removes a functionality for the user (being able to select and copy an FAQ question), which might be something a user usually expects.
This StackExchange post goes more into detail about the possible drawbacks of using this particular CSS property.
I especially like when they say:
The goal in employing user-select: none should always be limited to reducing user frustration from unintended selections resulting from interaction that can easily cause them when attempting to carry out the primary task purpose of a control it is used on.
I wonder if rapidly clicking the accordion qualifies as the "primary task purpose of a control"? In my own testing when I pulled down the branch, I had to click twice pretty fast in order to have some of the summary text getting highlighted.
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 do get ur point tho andrew and it is a shame that using <details>
leads to this regression, so if you feel like that adding user-select: none;
is worth it in this case, I'll defer to you here.
but let's also make sure that this is an exception bc i dont think we want to make this behavior standard
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.
Yeah, I had a feeling it was bad practice. I reverted that part! I agree with you that rapidly clicking might be something we do when testing it, but in practice, we wouldn't do that so I wouldn't consider it to be a "primary task purpose of a control".
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.
ok, sounds good then!
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.
Looks good! Since we are standardizing the accordions between the apply page and the course page, we should check to see which design to settle on before merging this one, in case we settle on the courses one.
I'll surface this in #idol-design. |
Vannessa brought up a good point that the Application and Courses Project Showcase Accordians are for different purposes, so it makes sense to make them different. So we decided not to standardize them. |
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.
THanksss!
<details className="border-white border-b-black border-2 cursor-pointer"> | ||
<summary className="section-subheading">{header}</summary> | ||
<div className="md:py-5 xs:py-3">{children}</div> | ||
</details> |
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.
yay
new-dti-website/src/app/globals.css
Outdated
} | ||
|
||
details { | ||
user-select: none; |
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.
hmmm...
i'm usually wary of using user-select: none;
because it removes a functionality for the user (being able to select and copy an FAQ question), which might be something a user usually expects.
This StackExchange post goes more into detail about the possible drawbacks of using this particular CSS property.
I especially like when they say:
The goal in employing user-select: none should always be limited to reducing user frustration from unintended selections resulting from interaction that can easily cause them when attempting to carry out the primary task purpose of a control it is used on.
I wonder if rapidly clicking the accordion qualifies as the "primary task purpose of a control"? In my own testing when I pulled down the branch, I had to click twice pretty fast in order to have some of the summary text getting highlighted.
new-dti-website/src/app/globals.css
Outdated
} | ||
|
||
details { | ||
user-select: none; |
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 do get ur point tho andrew and it is a shame that using <details>
leads to this regression, so if you feel like that adding user-select: none;
is worth it in this case, I'll defer to you here.
but let's also make sure that this is an exception bc i dont think we want to make this behavior standard
Summary
For the FAQ accordion here, we should use the
<details>
and<summary>
tags. See this MDN article for details.Notion/Figma Link
Part of #734
Test Plan
Verify FAQ Accordion looks and behaves the same as before.
Notes
Breaking Changes