Skip to content

Conversation

@crisbeto
Copy link
Member

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.

… 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.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent pr: merge safe target: patch This PR is targeted for the next patch release labels Sep 29, 2019
@crisbeto crisbeto requested a review from jelbourn as a code owner September 29, 2019 10:10
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 29, 2019
Copy link
Member

@jelbourn jelbourn left a 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';
Copy link
Member

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?

Copy link
Member Author

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.

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 30, 2019
@jelbourn jelbourn merged commit 17f2546 into angular:master Sep 30, 2019
andrewseguin pushed a commit that referenced this pull request Sep 30, 2019
… 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)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants