Skip to content

Commit

Permalink
feat(label): added option to show label on hover or click #25 from ee…
Browse files Browse the repository at this point in the history
…a/263484-label-hover
  • Loading branch information
ichim-david committed Feb 19, 2024
2 parents fe38ec9 + 8f03737 commit 6a0dc07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/editor/LabelWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const LabelWrapper = (props) => {
const {
uid,
always_show,
show_on_hover,
label_type,
label_pointing,
tooltip_type,
Expand All @@ -34,7 +35,7 @@ const LabelWrapper = (props) => {
}
position={tooltip_pointing}
open={always_show || undefined}
on={!always_show ? 'click' : undefined}
on={show_on_hover ? 'hover' : 'click'}
trigger={
label_type !== undefined && label_type !== 'simple' ? (
<label
Expand Down
6 changes: 6 additions & 0 deletions src/editor/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const LabelEditorSchema = {
'tooltip_type',
'tooltip_size',
'always_show',
'show_on_hover',
],
},
],
Expand Down Expand Up @@ -93,6 +94,11 @@ export const LabelEditorSchema = {
description: 'Always show the content label tooltip.',
type: 'boolean',
},
show_on_hover: {
title: 'Show tooltip on hover',
description: 'Show the content label tooltip on hover.',
type: 'boolean',
},
},
required: [],
};

0 comments on commit 6a0dc07

Please sign in to comment.