Skip to content

Commit 2e7c6cb

Browse files
committed
chore: add id for dropdown item value for automation testing
1 parent f496b7c commit 2e7c6cb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/react-dropdown/src/HighlightValue.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const HighlightValue = styled(
2929
if (highlight && valueToHighlight.length && value.length) {
3030
const splittedText = splitStringByValue(value, valueToHighlight, 1);
3131
return (
32-
<Value className={className}>
32+
<Value id={`highlight-value-${value}`} className={className}>
3333
{splittedText.map((chunk, index) => {
3434
return chunk.highlight ? (
3535
<Text key={index} as="span" type="bold">
@@ -43,7 +43,11 @@ const HighlightValue = styled(
4343
);
4444
}
4545

46-
return <Value className={className}>{value}</Value>;
46+
return (
47+
<Value id={`highlight-value-${value}`} className={className}>
48+
{value}
49+
</Value>
50+
);
4751
}
4852
)`
4953
${props => textStyles(props.disabled ? 'disabled' : '')};

0 commit comments

Comments
 (0)