Fix Bug 57260: textarea autofocus

This commit is contained in:
Viktor Fomin 2022-05-20 14:07:46 +03:00
parent df8e07e99f
commit 0058c3b22c
3 changed files with 8 additions and 1 deletions

View File

@ -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;

View File

@ -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};

View File

@ -172,6 +172,7 @@ const VersionRow = (props) => {
heightTextArea={54}
value={commentValue}
isDisabled={isSavingComment}
autoFocus={true}
/>
</>
)}