Skip to content
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

TextEditor: hacks to re-enable rendering on Firefox and copy/paste #5609

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Oct 10, 2023

Fixes #5545
Fixes #5600

"Fixes" is a bit exaggerated!

Basically I've noticed that the selection parsed by normalizeNative contained a node the code didn't expect so I tried to return null in that case and it worked (even if there's still an error in the console...).

On rendering in Firefox, browsers have different level of support for the Selection API and patching it for Firefox made things worse obviously, so I've disabled that and the widget can be rendered again and interacted with (there are still some weird behaviors).

Until Quill supports being rendered in the Shadow DOM, or we find a proper way to patch it, the TextEditor widget is going to behave strangely in some cases.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #5609 (79267d7) into main (497ad69) will decrease coverage by 0.93%.
Report is 1 commits behind head on main.
The diff coverage is 98.78%.

@@            Coverage Diff             @@
##             main    #5609      +/-   ##
==========================================
- Coverage   83.50%   82.57%   -0.93%     
==========================================
  Files         275      276       +1     
  Lines       39549    39631      +82     
==========================================
- Hits        33024    32727     -297     
- Misses       6525     6904     +379     
Flag Coverage Δ
ui-tests 39.06% <96.34%> (-1.76%) ⬇️
unitexamples-tests 73.33% <24.39%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
panel/tests/ui/widgets/test_texteditor.py 98.78% <98.78%> (ø)

... and 17 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until Quill itself fixes thing this seems like hacky but reasonable fix.

@philippjfr philippjfr merged commit 9772b8a into main Oct 10, 2023
@philippjfr philippjfr deleted the fix_copy_paste_plus_firefox_quill branch October 10, 2023 19:07
ahuang11 pushed a commit that referenced this pull request Oct 10, 2023
…5609)

* hacks to fix copy/paste and rendering on Firefox

* Fix copy-paste test on non-OSX platforms

---------

Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
ahuang11 pushed a commit that referenced this pull request Oct 10, 2023
…5609)

* hacks to fix copy/paste and rendering on Firefox

* Fix copy-paste test on non-OSX platforms

---------

Co-authored-by: Philipp Rudiger <prudiger@anaconda.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TextEditor widget doesn't render on FireFox Pasting text in the TextEditor no longer works
3 participants