bito-code-review[bot] commented on code in PR #40984:
URL: https://github.com/apache/superset/pull/40984#discussion_r3523797477
##########
superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx:
##########
@@ -690,7 +690,9 @@ const Select = forwardRef(
}
} else {
const token = tokenSeparators.find(token =>
pastedText.includes(token));
- const array = token ? uniq(pastedText.split(token)) : [pastedText];
+ const array = token
+ ? uniq(pastedText.split(token).map(s => s.trim()).filter(Boolean))
+ : [pastedText.trim()].filter(Boolean);
Review Comment:
<!-- Bito Reply -->
The suggestion to align `AsyncSelect.tsx` with the paste handling logic in
`Select.tsx` is correct. Applying the same `trim()` and `filter(Boolean)` logic
ensures consistent tokenization behavior across both components when users
paste text.
To apply this, update the paste handler in `AsyncSelect.tsx` to match the
logic shown in the diff for `Select.tsx`.
**superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx**
```
const token = tokenSeparators.find(token => pastedText.includes(token));
const array = token
? uniq(pastedText.split(token).map(s => s.trim()).filter(Boolean))
: [pastedText.trim()].filter(Boolean);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]