-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs] Improve the demo copy experience #19112
Comments
Thanks for raising the issue. It's been a while, but I seem to recall that this was left out as a shortcut when the copy capability was first added, with the intention to add it later. That clearly never happened! 🙂 Would you like to work on it? |
Definitely, I'll get right on it! |
"copy" accounts for 1.1% of demo events, compared to "expand" at 82.5%. (Being buried in the menu may partly account for that.) "GitHub" has a similar number of events despite being more visible, so there is some justification for swapping these. Do you have an example of a tooltip being used for a notification? It feels to me like it breaks expectations. (Funnily enough, GA uses a snackbar for this.) |
|
I believe it might be possible to make the title change accessible using an ARIA live region, but I'm not sure what screen readers read again if the live-region is on an element used for "aria-describedby" (i.e. does it also repeat the button information?). Arguably when the tooltip title changes to "copied" it no longer describes the button, but as the user has already heard the original description at that point, so that shouldn't be a problem. |
Right, I think that we can ignore the a11y part of this from the equation. The copied feedback is a nice attention to the detail. So Tooltip or Snackbar, sounds both great. |
@theswerd I'll let you cast the deciding vote with your PR 😄 |
@mbrookes Sorry for the wait, for some reason I thought I had already responded to this. I believe we should use a Snackbar because it will be more visible on mobile. I just submitted a pr that will do it! |
Thanks for resuming this effort :). 8% of the traffic is mobile on the documentation. We hide the demo actions, people can't copy on mobile, so we can completely ignore mobile for this concern. Does it change the tradeoff? |
Personally I prefer Snackbars over Tooltips, but @oliviertassinari's idea also seems good so I'll defer to you |
Given no clear winner, I think there's an argument for using the Snackbar, as it the more "Material" way of doing it. Also, since you've already created the PR based on Snackbar... |
It sounds great 👍 |
Checkout my pr #19291
…On Sun, Jan 19, 2020 at 12:11 PM Olivier Tassinari ***@***.***> wrote:
It sounds great 👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19112>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJEI4PTHJXZG6NYEKEPFNG3Q6SXWTANCNFSM4KDNZH2Q>
.
|
@oliviertassinari The other benefit is that it supports a notification when copying links to the source (in the menu) that have no tooltip. @theswerd has already implemented this. |
Summary 💡
When I click to copy code or links to code I want a snackbar to pop up to let me know the text has been copied.
Examples 🌈
When I press copy I want a to see a snackbar to let me know text has been copied.
Motivation 🔦
It annoys me when I can't tell if I have successfully copied or not.
This would solve that problem.
The text was updated successfully, but these errors were encountered: