michael-s-molina commented on code in PR #22273:
URL: https://github.com/apache/superset/pull/22273#discussion_r1037182632
##########
superset-frontend/src/components/Select/styles.tsx:
##########
@@ -52,6 +52,25 @@ export const StyledSelect = styled(AntdSelect, {
.ant-select-arrow .anticon:not(.ant-select-suffix) {
pointer-events: none;
}
+
+ ${
+ oneLine &&
+ `
+ .ant-select-selection-overflow {
+ flex-wrap: nowrap;
+ }
+
+
.ant-select-selection-overflow-item:not(.ant-select-selection-overflow-item-rest):not(.ant-select-selection-overflow-item-suffix)
{
+ flex-shrink: 1;
+ min-width: ${theme.gridUnit * 13}px;
+ }
+
+ .ant-select-selection-overflow-item-suffix {
+ flex: unset;
+ min-width: 0px;
+ }
+ `
+ }
Review Comment:
```suggestion
${
oneLine &&
`
.ant-select-selection-overflow {
flex-wrap: nowrap;
}
.ant-select-selection-overflow-item:not(.ant-select-selection-overflow-item-rest):not(.ant-select-selection-overflow-item-suffix)
{
flex-shrink: 1;
min-width: ${theme.gridUnit * 13}px;
}
.ant-select-selection-overflow-item-suffix {
flex: unset;
min-width: 0px;
}
`
}
```
##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx:
##########
@@ -72,6 +83,60 @@ function reducer(
}
}
+const StyledTag = styled(AntdTag)`
+ & .ant-tag-close-icon {
+ display: inline-flex;
+ align-items: center;
+ margin-left: ${({ theme }) => theme.gridUnit}px;
+ }
+
+ & .tag-content {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+`;
+
+export interface CustomTagProps extends HTMLSpanElement {
+ label: ReactNode;
+}
+
+// TODO: use antd Tag props instead of any. Currently it's causing a
typescript error
+const Tag = (props: any) => {
Review Comment:
It seems the custom render is necessary to make `oneLine` work correctly so
we need to move this code to the Select component.
--
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]