File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/super-editor/src/components/toolbar Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,14 @@ const getDropdownAttributes = (option, item) => {
105105};
106106
107107const handleClickOutside = (e ) => {
108+ const target = e .target ;
109+ const itemCtn = target .closest (' .toolbar-item-ctn' );
110+ const targetItemId = itemCtn? .dataset .itemId ;
111+
112+ if (targetItemId === currentItem .value .id ) {
113+ return ;
114+ }
115+
108116 closeDropdowns ();
109117};
110118
@@ -166,7 +174,6 @@ const handleKeyDown = (e, item) => {
166174
167175 switch (e .key ) {
168176 case ' Enter' :
169- console .log (' Enter' );
170177 handleToolbarButtonClick (item, null , false );
171178 break ;
172179 case ' Escape' :
@@ -215,6 +222,7 @@ const handleFocus = (e) => {
215222 class = " toolbar-item-ctn"
216223 ref= " toolbarItemRefs"
217224 : tabindex= " index === 0 ? 0 : -1"
225+ : data- item- id= " item.id.value"
218226 >
219227 <!-- toolbar separator -->
220228 < ToolbarSeparator v- if = " isSeparator(item)" style= " width: 20px" / >
You can’t perform that action at this time.
0 commit comments