Skip to content
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

Make "Copy" buttons actual buttons #22445

Merged
merged 1 commit into from
Apr 16, 2017
Merged

Make "Copy" buttons actual buttons #22445

merged 1 commit into from
Apr 16, 2017

Conversation

patrickhlauke
Copy link
Member

This makes them keyboard-accessible.

For mouse users, the only change here is that the focus outline will remain on the button once clicked (in future, this can be solved with :focus-ring, but for now this would require a polyfill).

the tooltip is explicitly hidden on mouseleave, so even though the <button> retains focus after clicking, the tooltip won't stay visible once mouse user moves away.

the mouse hover styles have explicitly NOT been make to also apply to :focus, so as to minimise the visual impact for mouse users (though the browser's default outline will remain visible).

$('.btn-clipboard').tooltip()
$('.btn-clipboard')
.tooltip()
.on('mouseleave', function (e) {
Copy link
Contributor

@wolfy1339 wolfy1339 Apr 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This argument is not needed, as it is not used anywhere. Because of that reason, tests are failing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, you're right. good spot. removed and force-pushed an update

This makes them keyboard-accessible. For mouse users, the only change
here is that the focus outline will remain on the button once clicked
(in future, this can be solved with :focus-ring, but for now this would
require a polyfill). the tooltip is explicitly hidden on `mouseleave`,
so even though the `<button>` retains focus after clicking, the tooltip
won't stay visible once mouse user moves away.
the mouse hover styles have explicitly not been make to also apply to
:focus, so as to minimise the visual impact for
mouse users (though the tooltip remains visible)
 - but due to the default outline and the custom tooltip, it
should be fairly clear when keyboard users set focus to a copy button
too.
@mdo mdo merged commit ea1d69c into twbs:v4-dev Apr 16, 2017
@mdo mdo mentioned this pull request Apr 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants