-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(cdk-experimental/clipboard): avoid changing layout with temporary textarea #17227
Conversation
… textarea Currently the clipboard service creates a temporary invisible `textarea` from which to copy the text into the clipboard, however since it only has `opacity: 0`, it has the potential of changing the layout in a noticeable way if it is present for longer. These changes add some extra styles to avoid changing the layout. I also did some small cleanup to make it a bit more robust.
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.
LGTM
// absolute position so the page layout isn't affected. | ||
styles.opacity = '0'; | ||
styles.position = 'absolute'; | ||
styles.left = styles.top = '-999em'; |
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.
Just out of curiosity: why em
?
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 particular reason. I just wanted to make sure that it's off-screen so I put in something that is guaranteed to be large.
… textarea (#17227) Currently the clipboard service creates a temporary invisible `textarea` from which to copy the text into the clipboard, however since it only has `opacity: 0`, it has the potential of changing the layout in a noticeable way if it is present for longer. These changes add some extra styles to avoid changing the layout. I also did some small cleanup to make it a bit more robust. (cherry picked from commit 17f2546)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently the clipboard service creates a temporary invisible
textarea
from which to copy the text into the clipboard, however since it only hasopacity: 0
, it has the potential of changing the layout in a noticeable way if it is present for longer.These changes add some extra styles to avoid changing the layout. I also did some small cleanup to make it a bit more robust.