[MM-54515] Fix textarea not working in interactive dialog (#24586)

Этот коммит содержится в:
Julien Tant
2023-10-24 13:25:18 -07:00
коммит произвёл GitHub
родитель cd39edc3ff
Коммит da20a036a3
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@@ -22,6 +22,16 @@ describe('components/interactive_dialog/DialogElement', () => {
onChange: jest.fn(), onChange: jest.fn(),
}; };
it('type textarea', () => {
const wrapper = shallow(
<DialogElement
{...baseDialogProps}
type='textarea'
/>,
);
expect(wrapper.find(TextSetting).dive().find('textarea').exists()).toBe(true);
});
it('subtype blank', () => { it('subtype blank', () => {
const wrapper = shallow( const wrapper = shallow(
<DialogElement <DialogElement

Просмотреть файл

@@ -174,7 +174,7 @@ export default class DialogElement extends React.PureComponent<Props, State> {
<TextSetting <TextSetting
autoFocus={this.props.autoFocus} autoFocus={this.props.autoFocus}
id={name} id={name}
type={subtype as InputTypes || 'text'} type={(type === 'textarea' ? 'textarea' : subtype) as InputTypes || 'text'}
label={displayNameContent} label={displayNameContent}
maxLength={textSettingMaxLength} maxLength={textSettingMaxLength}
value={assertedValue} value={assertedValue}