Skip to content

Commit

Permalink
truncate tag text (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
khoait authored Dec 18, 2024
1 parent df27233 commit c99804b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PolyLookupComponent/PolyLookup/ControlManifest.Input.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest>
<control namespace="DCEPCF" constructor="PolyLookup" version="1.7.0" display-name-key="PolyLookup v1.7.0" description-key="Multi-select lookup supporting different type of many-to-many relationships" control-type="standard" >
<control namespace="DCEPCF" constructor="PolyLookup" version="1.7.1" display-name-key="PolyLookup v1.7.1" description-key="Multi-select lookup supporting different type of many-to-many relationships" control-type="standard" >
<!--external-service-usage node declares whether this 3rd party PCF control is using external service or not, if yes, this control will be considered as premium and please also add the external domain it is using.
If it is not using any external service, please set the enabled="false" and DO NOT add any domain below. The "enabled" will be false by default.
Example1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ const useStyle = makeStyles({
transparentBackground: {
backgroundColor: tokens.colorTransparentBackground,
},
truncatedText: {
whiteSpace: "nowrap",
overflowX: "hidden",
textOverflow: "ellipsis",
},
});

export default function PolyLookupControlNewLook({
Expand Down Expand Up @@ -95,8 +100,16 @@ export default function PolyLookupControlNewLook({
onQuickCreate,
}: PolyLookupProps) {
const queryClient = useQueryClient();
const { tagGroup, marginLeft, underline, borderTransparent, tagFontSize, iconFontSize, transparentBackground } =
useStyle();
const {
tagGroup,
marginLeft,
underline,
borderTransparent,
tagFontSize,
iconFontSize,
transparentBackground,
truncatedText,
} = useStyle();

const tagStyle = mergeClasses(!!tagAction && underline);
const iconStyle = mergeClasses(borderTransparent, iconFontSize);
Expand Down Expand Up @@ -359,6 +372,9 @@ export default function PolyLookupControlNewLook({
/>
) : undefined
}
primaryText={{
className: truncatedText,
}}
onClick={() => handleOnItemClick(i)}
>
<span className={tagFontSize}>{i.selectedOptionText}</span>
Expand Down

0 comments on commit c99804b

Please sign in to comment.