From b8dff94f7bebfcb7f81f36f588f110e08e34ef9f Mon Sep 17 00:00:00 2001 From: Julien Fabre Date: Tue, 23 Apr 2024 23:00:32 +0200 Subject: [PATCH] fix(#150): add maxlength on input (#222) * fix(issue#150): add maxlength on input * fix: lint problems --- .../user_selector/autocomplete_selector.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/user_selector/autocomplete_selector.tsx b/webapp/src/components/user_selector/autocomplete_selector.tsx index 09aadf18..9312cabc 100644 --- a/webapp/src/components/user_selector/autocomplete_selector.tsx +++ b/webapp/src/components/user_selector/autocomplete_selector.tsx @@ -3,6 +3,7 @@ import React, {CSSProperties} from 'react'; +import {components} from 'react-select'; import AsyncSelect from 'react-select/async'; import {OptionsType, ValueType, Theme as ComponentTheme} from 'react-select/src/types'; import {Props as ComponentProps, StylesConfig} from 'react-select/src/styles'; @@ -51,7 +52,7 @@ const useTheme = (mattermostTheme: Theme): [StylesConfig, ThemeConfig] => { return [styles, compTheme]; }; -const renderOption = (option: UserProfile, {context} : {context: FormatOptionLabelContext}) => { +const renderOption = (option: UserProfile, {context}: {context: FormatOptionLabelContext}) => { const {username} = option; const name = `@${username}`; const description = getDescription(option); @@ -116,6 +117,13 @@ export default function AutocompleteSelector(props: Props) { ); } + //@ts-ignore + const Input = (inputProps) => ( + ); + return (