Import - fixes (#12569)
<img width="800" alt="Screenshot 2025-06-12 at 15 22 49" src="https://github.com/user-attachments/assets/afaa4ef1-b16c-4c05-ba4a-d77ad2ccfa76" /> To test : - unselect an option on select/multi-select matching (matching step) - match a mutli-select field with an other field closes : https://github.com/twentyhq/core-team-issues/issues/1065 closes : https://github.com/twentyhq/core-team-issues/issues/1066
This commit is contained in:
@ -14,9 +14,16 @@ export const setSubColumn = <T>(
|
||||
):
|
||||
| SpreadsheetMatchedSelectColumn<T>
|
||||
| SpreadsheetMatchedSelectOptionsColumn<T> => {
|
||||
const shouldUnselectValue =
|
||||
oldColumn.matchedOptions.find((option) => option.entry === entry)?.value ===
|
||||
value;
|
||||
|
||||
const options = oldColumn.matchedOptions.map((option) =>
|
||||
option.entry === entry ? { ...option, value } : option,
|
||||
option.entry === entry
|
||||
? { ...option, value: shouldUnselectValue ? undefined : value }
|
||||
: option,
|
||||
);
|
||||
|
||||
const allMatched = options.every(({ value }) => !!value);
|
||||
if (allMatched) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user