feat: use span to properly truncate text inside button

This commit is contained in:
karishmas6
2024-08-21 22:32:04 +05:30
parent 947a3d734b
commit 0078b869df

View File

@@ -250,12 +250,21 @@ export const BrowserWindow = () => {
key={option.value} key={option.value}
onClick={() => handleAttributeSelection(option.value)} onClick={() => handleAttributeSelection(option.value)}
style={{ style={{
justifyContent: 'flex-start', whiteSpace: 'nowrap', justifyContent: 'flex-start',
maxWidth: '200px',
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis' padding: '5px 10px',
}} }}
> >
<span style={{
display: 'block',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '100%'
}}>
{option.label} {option.label}
</span>
</Button> </Button>
))} ))}
</div> </div>
@@ -264,6 +273,7 @@ export const BrowserWindow = () => {
) : null ) : null
} }
{((getText === true || getList === true) && !showAttributeModal && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ? {((getText === true || getList === true) && !showAttributeModal && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?
<Highlighter <Highlighter
unmodifiedRect={highlighterData?.rect} unmodifiedRect={highlighterData?.rect}