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
ZERO WIDTH SPACE (U+200B) in path copied if selection is not exact #7513
Comments
Another side-effect of #5184 is that if you select text like this: |
@MingweiSamuel nice catch. Are you willing to entertain a PR with the fix? |
Sure |
Great! Looking forward |
MingweiSamuel
added a commit
to MingweiSamuel/swagger-ui
that referenced
this issue
Sep 17, 2021
…#7516) - Use <wbr> instead of ZERO-WIDTH SPACE (U+200B) to break segments in operation-summary-path.jsx - Remove no-longer-needed onCopyCapture listener which previously stripped ZWSPs Closes swagger-api#7513
MingweiSamuel
added a commit
to MingweiSamuel/swagger-ui
that referenced
this issue
Sep 17, 2021
- Use <wbr> instead of ZERO-WIDTH SPACE (U+200B) to break segments in operation-summary-path.jsx - Remove no-longer-needed onCopyCapture listener which previously stripped ZWSPs Closes swagger-api#7513
17 tasks
MingweiSamuel
added a commit
to MingweiSamuel/swagger-ui
that referenced
this issue
Sep 17, 2021
- Use <wbr> instead of ZERO-WIDTH SPACE (U+200B) to break segments in operation-summary-path.jsx - Remove no-longer-needed onCopyCapture listener which previously stripped ZWSPs Closes swagger-api#7513
MingweiSamuel
added a commit
to MingweiSamuel/swagger-ui
that referenced
this issue
Sep 19, 2021
- Use <wbr> instead of ZERO-WIDTH SPACE (U+200B) to break segments in operation-summary-path.jsx - Remove no-longer-needed onCopyCapture listener which previously stripped ZWSPs Closes swagger-api#7513
MingweiSamuel
added a commit
to MingweiSamuel/swagger-ui
that referenced
this issue
Sep 22, 2021
- Use <wbr> instead of ZERO-WIDTH SPACE (U+200B) to break segments in operation-summary-path.jsx - Remove no-longer-needed onCopyCapture listener which previously stripped ZWSPs - Update's deep-link.jsx's `text` prop type to accept `PropType.node` to allow the above. Closes swagger-api#7513
MingweiSamuel
added a commit
to MingweiSamuel/swagger-ui
that referenced
this issue
Sep 22, 2021
- Use <wbr> instead of ZERO-WIDTH SPACE (U+200B) to break segments in operation-summary-path.jsx - Remove no-longer-needed onCopyCapture listener which previously stripped ZWSPs - Update's deep-link.jsx's `text` prop type to accept `PropType.node` to allow the above. Closes swagger-api#7513
char0n
pushed a commit
that referenced
this issue
Sep 30, 2021
- use <wbr> instead of ZERO-WIDTH SPACE (U+200B) to break segments - remove no-longer-needed onCopyCapture listener which previously stripped ZWSPs - update's deep-link.jsx's `text` prop type to accept `PropType.node` to allow the above. Closes #7513 Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Q&A (please complete the following information)
dist/
Describe the bug you're encountering
If you drag to select the path, but select a little bit too far, the zero-width space removal doesn't happen, and you copy a bunch of zero-width spaces into your code to cause invisible bugs.
To reproduce...
Steps to reproduce the behavior:
Screenshots
Will copy zero width spaces (on left and in middle of path).
If you very carefully stop at the start of the text things will be OK:
(OK)
Cause
Caused by #5184
The PR above injects zero width spaces into the path, but includes an
onCopyCapture
function which is triggered when the user copies, which removes all zero width spaces from the copied text. However that event is only triggered if the selection is only on the path<span>
. In reality, users will often drag a little further to make sure all the characters are selected, but this (for some reason) means theonCopyCapture
is not triggered and ZERO WIDTH SPACEs are copied.Fix
<wbr>
should be used instead, which requires noonCopyCapture
faffing: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbrThe text was updated successfully, but these errors were encountered: