This repository has been archived by the owner on May 24, 2024. It is now read-only.
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.
[terra-embedded-content-consumer] - Show focus indicator on iframe of the embedded content when it has focus #1827
[terra-embedded-content-consumer] - Show focus indicator on iframe of the embedded content when it has focus #1827
Changes from all commits
368c3fc
47a1105
2685b29
836bd5c
5e8e4c8
4bedf98
93d9aa3
2e9e450
3bf6808
0727c53
e04850d
4b57dc3
6f6d1d9
49aa11d
0ecd9dd
636f744
550ca80
01d2771
f417dbd
ec511e2
b1d1148
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.
We should not need to add this third-party dependency.
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.
Good call. With the current way, there is just 1 style for focus
outline
, and one style for bluroutline
and we have two variables for these. We can set the value for each into the frame's style directly. Previously, I was thinking that we could set multiple style attributes for focus or blur.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.
The contentWindow gives you a reference to the window for the embedded content. You should be able to use document.documentElement (HTML tag) or document.body to handle the logic as necessary.
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'd like to handle the focus within the iframe element though, not everywhere else in the document body.
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 you can handle by styling the iFrame element. How are you giving focus to your iFrame? Did you set a tabIndex?
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.
Instead of this logic, you should be able to use the ":focus" psuedo class.
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.
Can you give an example on how to setup the style and apply to the iframe's style?
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.
Like this?
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 would think that your iFrame would have an associated class name or id for styling. However, it would be a similar concept to what you have described here, yes.
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.
The :focus pseudo-class isn't working for iframe. I'll check to see if we can update the classname on the fly for switching the style.
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.
You should be able to set the styles using classes. I don't think that this is the correct implementation.
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.
These are not for the classes to be applied to an html element like we normally do.
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.
You would add the class to the iFrame element.
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 shouldn't need a blur outline style. That should just be the normal state of the element.
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.
Are you saying we can hard-code
outline: none
to remove the style from the frame when there is no focus anymore? Because we set theoutline
style when there is focus. And if we don't remove that style, it stays.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.
No, I am saying that you would have CSS for the normal state. When the element is not focused, that CSS will no longer be applied.
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.
nit: We can add a
.
at the EOL.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.
nit: can we keep the newline here or remove it from the other doc files as well?