mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 03:14:39 +08:00
fix(toolbar): Don't show the toolbar when rangeInScope is null
This commit is contained in:
parent
8a40af6830
commit
cc8a32e22f
1 changed files with 4 additions and 1 deletions
|
@ -14,13 +14,16 @@ class ToolbarButtonManager extends ContenteditableExtension
|
||||||
return null unless toolbarState.selectionSnapshot
|
return null unless toolbarState.selectionSnapshot
|
||||||
return null if toolbarState.selectionSnapshot.isCollapsed
|
return null if toolbarState.selectionSnapshot.isCollapsed
|
||||||
|
|
||||||
|
locationRef = DOMUtils.getRangeInScope(toolbarState.editableNode)
|
||||||
|
return null unless locationRef
|
||||||
|
|
||||||
buttonConfigs = @_toolbarButtonConfigs(toolbarState)
|
buttonConfigs = @_toolbarButtonConfigs(toolbarState)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
component: ToolbarButtons
|
component: ToolbarButtons
|
||||||
props:
|
props:
|
||||||
buttonConfigs: buttonConfigs
|
buttonConfigs: buttonConfigs
|
||||||
locationRefNode: DOMUtils.getRangeInScope(toolbarState.editableNode)
|
locationRefNode: locationRef
|
||||||
width: buttonConfigs.length * 28.5
|
width: buttonConfigs.length * 28.5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue