1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

add a zero width space to Badges to fix double click highlighting issue (#914)

* add a zero width space to Badges to fix double click highlighting issue

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2020-09-18 02:33:43 -04:00 committed by GitHub
parent d09a118b0c
commit 9a9f50ab34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,11 +13,18 @@ interface Props extends React.HTMLAttributes<any>, TooltipDecoratorProps {
export class Badge extends React.Component<Props> { export class Badge extends React.Component<Props> {
render() { render() {
const { className, label, small, children, ...elemProps } = this.props; const { className, label, small, children, ...elemProps } = this.props;
return ( return <>
<span className={cssNames("Badge", { small }, className)} {...elemProps}> <span className={cssNames("Badge", { small }, className)} {...elemProps}>
{label} {label}
{children} {children}
</span> </span>
); { /**
* This is a zero-width-space. It makes there be a word seperation
* between adjacent Badge's because <span>'s are ignored for browers'
* word detection algorithmns use for determining the extent of the
* text to highlight on multi-click sequences.
*/}
&#8203;
</>
} }
} }