-
Notifications
You must be signed in to change notification settings - Fork 47
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
#1711: Include focus on tooltip link #1712
Conversation
Signed-off-by: srikant <[email protected]>
This isn't working well. I press Also Screen.Recording.2024-02-20.at.10.12.41.AM.movIn Carbon demo, When tooltip is open and link is in focus, when I press carbon-demo.movTo mimic this behavior, Our tooltip code will have to capture the key presses and (if there is only one link) suppress them (and also any Shift + Tab key presses) - then capture the ESC key press and close the tip in that case. You can try |
…etain tabbing Signed-off-by: srikant <[email protected]>
Hi @nmgokhale I have updated PR with above changes please review and let me know of any changes. |
…ooltip icon Signed-off-by: srikant <[email protected]>
@@ -320,6 +331,9 @@ class ToolTip extends React.Component { | |||
// To prevent this default behavior, stopPropagation and preventDefault is used. | |||
evt.stopPropagation(); | |||
evt.preventDefault(); | |||
|
|||
// when tooltip with link is closed and another tooltip is opened newly opened tooltip should have focus |
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 start sentences in the comments with a capital letter. If you start with a lowercase letter it looks like part of the sentence has been lost.
} | ||
}} | ||
onBlur={() => { | ||
if (linkClicked) { // keep tooltip open when link is clicked |
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.
First letter in upper case please
evt.stopPropagation(); | ||
evt.preventDefault(); | ||
|
||
if (evt.key === "Escape") { // When Esc is pressed shift the focus to tooltip icon so that user can navigate following elements. |
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 avoid having inline comments like this stretch too far across the screen. Short comments are OK but with one this length I'd prefer it to be above the if
statement. BTW - I do appreciate this file even has code that stretches a long way across the page so that is not a good model to follow. Ah! If only I could go back and re-review it ;-)
Signed-off-by: srikant <[email protected]>
Hi @tomlyn I have updated comments as per above format. Thanks. |
Hi @nmgokhale. Could you please review this PR and let me know incase of any changes needed ? |
@srikant-ch5 Issue #1711 didn't close after merging this PR. Next time in the PR description, please add |
Ref: #1711
Developer's Certificate of Origin 1.1