rusackas commented on code in PR #41136:
URL: https://github.com/apache/superset/pull/41136#discussion_r3477454520
##########
superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx:
##########
@@ -690,20 +693,34 @@ 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(item => item.trim())
+ .filter(Boolean),
+ )
+ : [pastedText.trim()];
Review Comment:
Good catch — the no-separator branch now drops blank tokens too, so an
all-whitespace paste no longer creates an empty option. Added a test.
##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx:
##########
@@ -592,6 +592,7 @@ export default function PluginFilterSelect(props:
PluginFilterSelectProps) {
allowClear
autoClearSearchValue
allowNewOptions={!searchAllOptions && creatable !== false}
+ allowNewOptionsOnPaste={multiSelect && searchAllOptions}
Review Comment:
`allowNewOptionsOnPaste` already behaved this way for these filters before
this PR — it just no longer drops values outside the loaded page.
Datatype-aware coercion for numeric/temporal columns is a separate concern that
predates this change, so Id rather not fold it in here.
--
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]