Fix Bug 57260: textarea autofocus
This commit is contained in:
parent
df8e07e99f
commit
0058c3b22c
@ -25,6 +25,7 @@ class Textarea extends React.PureComponent {
|
||||
heightTextArea,
|
||||
color,
|
||||
theme,
|
||||
autoFocus,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
@ -50,6 +51,7 @@ class Textarea extends React.PureComponent {
|
||||
value={value}
|
||||
fontSize={fontSize}
|
||||
color={color}
|
||||
autoFocus={autoFocus}
|
||||
/>
|
||||
</StyledScrollbar>
|
||||
);
|
||||
@ -89,6 +91,7 @@ Textarea.propTypes = {
|
||||
heightTextArea: PropTypes.number,
|
||||
/** Specifies the text color */
|
||||
color: PropTypes.string,
|
||||
autoFocus: PropTypes.bool,
|
||||
};
|
||||
|
||||
Textarea.defaultProps = {
|
||||
@ -101,6 +104,7 @@ Textarea.defaultProps = {
|
||||
tabIndex: -1,
|
||||
value: "",
|
||||
fontSize: 13,
|
||||
isAutoFocussed: false,
|
||||
};
|
||||
|
||||
export default Textarea;
|
||||
|
@ -48,7 +48,9 @@ const ClearTextareaAutosize = ({
|
||||
...props
|
||||
}) => <TextareaAutosize {...props} />;
|
||||
|
||||
const StyledTextarea = styled(ClearTextareaAutosize)`
|
||||
const StyledTextarea = styled(ClearTextareaAutosize).attrs((props) => ({
|
||||
autoFocus: props.autoFocus,
|
||||
}))`
|
||||
${commonInputStyle};
|
||||
|
||||
width: ${(props) => props.theme.textArea.width};
|
||||
|
@ -172,6 +172,7 @@ const VersionRow = (props) => {
|
||||
heightTextArea={54}
|
||||
value={commentValue}
|
||||
isDisabled={isSavingComment}
|
||||
autoFocus={true}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user