mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
fix(toolbar): Don't show the toolbar when rangeInScope is null
This commit is contained in:
parent
56c27ff004
commit
b1b48c08f4
|
@ -14,13 +14,16 @@ class ToolbarButtonManager extends ContenteditableExtension
|
|||
return null unless toolbarState.selectionSnapshot
|
||||
return null if toolbarState.selectionSnapshot.isCollapsed
|
||||
|
||||
locationRef = DOMUtils.getRangeInScope(toolbarState.editableNode)
|
||||
return null unless locationRef
|
||||
|
||||
buttonConfigs = @_toolbarButtonConfigs(toolbarState)
|
||||
|
||||
return {
|
||||
component: ToolbarButtons
|
||||
props:
|
||||
buttonConfigs: buttonConfigs
|
||||
locationRefNode: DOMUtils.getRangeInScope(toolbarState.editableNode)
|
||||
locationRefNode: locationRef
|
||||
width: buttonConfigs.length * 28.5
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue