Avoid rerendering the list selection
[MAILPOET-2677]
This commit is contained in:
committed by
Veljko V
parent
5bf85c4db6
commit
8c63228eaa
@@ -18,7 +18,8 @@ export default (props: Props) => {
|
||||
const idSelector = `#${id}`;
|
||||
$(idSelector).select2();
|
||||
$(idSelector).on('change', (e) => {
|
||||
setValue(Array.from(e.target.selectedOptions).map((x: any) => x.value));
|
||||
const value = Array.from(e.target.selectedOptions).map((x: any) => x.value);
|
||||
setValue(value);
|
||||
});
|
||||
return () => $(idSelector).select2('destroy');
|
||||
}, [id, setValue]);
|
||||
|
Reference in New Issue
Block a user