1
- import * as React from 'react ' ;
1
+ import classNames from 'classnames ' ;
2
2
import ResizeObserver from 'rc-resize-observer' ;
3
3
import omit from 'rc-util/lib/omit' ;
4
- import classNames from 'classnames' ;
5
- import calculateNodeHeight from './calculateNodeHeight' ;
6
- import type { TextAreaProps } from '.' ;
4
+ import * as React from 'react' ;
7
5
import shallowEqual from 'shallowequal' ;
6
+ import type { TextAreaProps } from '.' ;
7
+ import calculateNodeHeight from './calculateNodeHeight' ;
8
8
9
9
// eslint-disable-next-line @typescript-eslint/naming-convention
10
10
enum RESIZE_STATUS {
@@ -93,7 +93,6 @@ class ResizableTextArea extends React.Component<TextAreaProps, TextAreaState> {
93
93
this . setState ( { resizeStatus : RESIZE_STATUS . RESIZED } , ( ) => {
94
94
this . resizeFrameId = requestAnimationFrame ( ( ) => {
95
95
this . setState ( { resizeStatus : RESIZE_STATUS . NONE } ) ;
96
- this . fixFirefoxAutoScroll ( ) ;
97
96
} ) ;
98
97
} ) ;
99
98
} ) ;
@@ -106,21 +105,6 @@ class ResizableTextArea extends React.Component<TextAreaProps, TextAreaState> {
106
105
cancelAnimationFrame ( this . resizeFrameId ) ;
107
106
}
108
107
109
- // https://github.com/ant-design/ant-design/issues/21870
110
- fixFirefoxAutoScroll ( ) {
111
- try {
112
- if ( document . activeElement === this . textArea ) {
113
- const currentStart = this . textArea . selectionStart ;
114
- const currentEnd = this . textArea . selectionEnd ;
115
- this . textArea . setSelectionRange ( currentStart , currentEnd ) ;
116
- }
117
- } catch ( e ) {
118
- // Fix error in Chrome:
119
- // Failed to read the 'selectionStart' property from 'HTMLInputElement'
120
- // http://stackoverflow.com/q/21177489/3040605
121
- }
122
- }
123
-
124
108
renderTextArea = ( ) => {
125
109
const {
126
110
prefixCls = 'rc-textarea' ,
0 commit comments