Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: key and value text should be selectable #217

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/DataKeyPair.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ export const DataKeyPair: React.FC<DataKeyPairProps> = (props) => {
return (
<Box className='data-key-pair'
data-testid={'data-key-pair' + path.join('.')}
sx={{
userSelect: 'text'
}}
onMouseEnter={
useCallback(() => setHover(path, nestedIndex),
[setHover, path, nestedIndex])
Expand Down
3 changes: 2 additions & 1 deletion src/components/DataTypeLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const DataTypeLabel: React.FC<DataLabelProps> = ({
sx={{
mx: 0.5,
fontSize: '0.7rem',
opacity: 0.8
opacity: 0.8,
userSelect: 'none'
}}
>{dataType}</DataBox>
)
Expand Down
15 changes: 10 additions & 5 deletions src/components/DataTypes/Object.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const PreObjectType: React.FC<DataItemProps<object>> = (props) => {
sx={{
pl: 0.5,
fontStyle: 'italic',
color: metadataColor
color: metadataColor,
userSelect: 'none'
}}
>
{sizeOfValue}
Expand Down Expand Up @@ -91,7 +92,8 @@ export const PostObjectType: React.FC<DataItemProps<object>> = (props) => {
sx={{
pl: 0.5,
fontStyle: 'italic',
color: metadataColor
color: metadataColor,
userSelect: 'none'
}}
>
{sizeOfValue}
Expand Down Expand Up @@ -163,7 +165,8 @@ export const ObjectType: React.FC<DataItemProps<object>> = (props) => {
lineHeight: 1.5,
color: keyColor,
letterSpacing: 0.5,
opacity: 0.8
opacity: 0.8,
userSelect: 'none'
}}
key='last'
onClick={() => setDisplayLength(length => length * 2)}
Expand Down Expand Up @@ -207,7 +210,8 @@ export const ObjectType: React.FC<DataItemProps<object>> = (props) => {
lineHeight: 1.5,
color: keyColor,
letterSpacing: 0.5,
opacity: 0.8
opacity: 0.8,
userSelect: 'none'
}}
key='last'
onClick={() => setDisplayLength(length => length * 2)}
Expand Down Expand Up @@ -253,7 +257,8 @@ export const ObjectType: React.FC<DataItemProps<object>> = (props) => {
onClick={() => props.setInspect(true)}
sx={{
'&:hover': { cursor: 'pointer' },
padding: 0.5
padding: 0.5,
userSelect: 'none'
}}
>
Expand Down