mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	fix(context menu): not auto-closing on mobile (#2331)
This commit is contained in:
		
						commit
						9cb227c1ca
					
				| @ -194,14 +194,15 @@ class ContextMenu { | |||||||
|                         return false; |                         return false; | ||||||
|                     }); |                     }); | ||||||
| 
 | 
 | ||||||
|                 if (!this.isMobile) { |  | ||||||
|                 $item.on("mouseup", (e) => { |                 $item.on("mouseup", (e) => { | ||||||
|  |                     // Prevent submenu from failing to expand on mobile
 | ||||||
|  |                     if (!this.isMobile || !("items" in item && item.items)) { | ||||||
|                         e.stopPropagation(); |                         e.stopPropagation(); | ||||||
|                         // Hide the content menu on mouse up to prevent the mouse event from propagating to the elements below.
 |                         // Hide the content menu on mouse up to prevent the mouse event from propagating to the elements below.
 | ||||||
|                         this.hide(); |                         this.hide(); | ||||||
|                         return false; |                         return false; | ||||||
|                     }); |  | ||||||
|                     } |                     } | ||||||
|  |                 }); | ||||||
| 
 | 
 | ||||||
|                 if ("enabled" in item && item.enabled !== undefined && !item.enabled) { |                 if ("enabled" in item && item.enabled !== undefined && !item.enabled) { | ||||||
|                     $item.addClass("disabled"); |                     $item.addClass("disabled"); | ||||||
|  | |||||||
| @ -391,7 +391,7 @@ body.desktop .dropdown-menu { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| body.desktop .dropdown-menu:not(#context-menu-container) .dropdown-item, | body.desktop .dropdown-menu:not(#context-menu-container) .dropdown-item, | ||||||
| body.desktop #context-menu-container .dropdown-item > span { | body #context-menu-container .dropdown-item > span { | ||||||
|     display: flex; |     display: flex; | ||||||
|     align-items: center; |     align-items: center; | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran