mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	popover_menus: Fix tippy instance being undefined.
				
					
				
			Since the reference element can be removed from DOM, we rely on `popper` here to access the tippy instance which is reliable.
This commit is contained in:
		@@ -212,8 +212,10 @@ export const default_popover_props: Partial<tippy.Props> = {
 | 
			
		||||
                phase: "beforeWrite",
 | 
			
		||||
                requires: ["$$tippy"],
 | 
			
		||||
                fn({state}) {
 | 
			
		||||
                    // Since the reference element can be removed from DOM, we rely on popper
 | 
			
		||||
                    // here to access the tippy instance which is reliable.
 | 
			
		||||
                    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
 | 
			
		||||
                    const instance = (state.elements.reference as tippy.ReferenceElement)._tippy!;
 | 
			
		||||
                    const instance = (state.elements.popper as tippy.PopperElement)._tippy!;
 | 
			
		||||
                    const $popover = $(state.elements.popper);
 | 
			
		||||
                    const $tippy_box = $popover.find(".tippy-box");
 | 
			
		||||
                    // $tippy_box[0].hasAttribute("data-reference-hidden"); is the real check
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user