-
Notifications
You must be signed in to change notification settings - Fork 37
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: Inconsistent use of accents in Safari #16 #18
base: master
Are you sure you want to change the base?
fix: Inconsistent use of accents in Safari #16 #18
Conversation
e5606d1
to
22401aa
Compare
Codecov Report
@@ Coverage Diff @@
## master #18 +/- ##
==========================================
+ Coverage 98.02% 98.05% +0.02%
==========================================
Files 3 3
Lines 152 154 +2
Branches 45 47 +2
==========================================
+ Hits 149 151 +2
Misses 3 3
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
22401aa
to
b63ed56
Compare
Root cause: Added this code block:
This code will cause many safari problems regard of composition event. the fixFirefoxAutoScroll should only be called when the browser is firefox. But currently, it will also be called in safari or other browsers |
61a4ee9
to
e5cf396
Compare
src/ResizableTextArea.tsx
Outdated
@@ -109,7 +109,10 @@ class ResizableTextArea extends React.Component<TextAreaProps, TextAreaState> { | |||
// https://github.com/ant-design/ant-design/issues/21870 | |||
fixFirefoxAutoScroll() { | |||
try { | |||
if (document.activeElement === this.textArea) { | |||
if ( | |||
navigator.userAgent.includes('Firefox') && |
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.
Don't use UA but feature detection.
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.
Safari or Firefox.
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.
Fixed,
use window.hasOwnProperty('mozInnerScreenX') instead
e5cf396
to
8f41453
Compare
QQ, is this accents stuff not a problem in Firefox as well? Was wondering if you've tried doing something like
instead of using the EDIT: Never mind, did some more testing and the above is buggy, breaks if you are typing in the middle and your cursor then exits the visible area and some other cases. |
…s enabled