fix link input not hiding

This commit is contained in:
ammarahm-ed
2021-02-09 09:30:03 +05:00
parent 6d80dcbc02
commit f2d113a90f
2 changed files with 9 additions and 2 deletions

View File

@@ -62,6 +62,10 @@ const ToolbarItem = ({
const checkForChanges = (data) => {
properties.selection = data;
let formats = Object.keys(data);
if (!data['link']) {
eSendEvent('showTooltip');
}
if (format === 'header' && type === 'tooltip') {
let keys = group.map((i) => i.format);
keys.forEach((k) => {
@@ -288,8 +292,10 @@ const ToolbarItem = ({
<ToolbarItemPin format={format} color={selected && color} />
)}
{/^(h1|h2|h3|h4|h5|h6|p)$/.test(format)? (
<Heading size={SIZE.md + 2} color={selected ? colors.accent : colors.pri}>
{/^(h1|h2|h3|h4|h5|h6|p)$/.test(format) ? (
<Heading
size={SIZE.md + 2}
color={selected ? colors.accent : colors.pri}>
{format.slice(0, 1).toUpperCase() + format.slice(1)}
</Heading>
) : /^(ol|ul|cl)$/.test(format) ? (

View File

@@ -38,6 +38,7 @@ const Tooltip = () => {
const show = (data) => {
properties.userBlur = true;
if (!data) {
console.log('hiding')
setVisible(false);
editing.tooltip = null;
return;