Skip to content

Commit

Permalink
feat: add logic to toggle tooltip message on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
hazigabriel committed Jan 26, 2024
1 parent 27fbcea commit 572a890
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 label hover',
description: 'Show the content label tooltip on hover.',
type: 'boolean',
},
},
required: [],
};

0 comments on commit 572a890

Please sign in to comment.