mirror of
				https://github.com/cinnyapp/cinny.git
				synced 2025-11-04 06:20:28 +03:00 
			
		
		
		
	fix crash on emoji selection from emojiboard (#2249)
* fix crash on emoji select * fix crash in message editor on emoji select
This commit is contained in:
		
							parent
							
								
									19cf700d61
								
							
						
					
					
						commit
						5d00383d71
					
				
					 2 changed files with 14 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -600,8 +600,13 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
 | 
			
		|||
                        onCustomEmojiSelect={handleEmoticonSelect}
 | 
			
		||||
                        onStickerSelect={handleStickerSelect}
 | 
			
		||||
                        requestClose={() => {
 | 
			
		||||
                          setEmojiBoardTab(undefined);
 | 
			
		||||
                          if (!mobileOrTablet()) ReactEditor.focus(editor);
 | 
			
		||||
                          setEmojiBoardTab((t) => {
 | 
			
		||||
                            if (t) {
 | 
			
		||||
                              if (!mobileOrTablet()) ReactEditor.focus(editor);
 | 
			
		||||
                              return undefined;
 | 
			
		||||
                            }
 | 
			
		||||
                            return t;
 | 
			
		||||
                          });
 | 
			
		||||
                        }}
 | 
			
		||||
                      />
 | 
			
		||||
                    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -305,8 +305,13 @@ export const MessageEditor = as<'div', MessageEditorProps>(
 | 
			
		|||
                            onEmojiSelect={handleEmoticonSelect}
 | 
			
		||||
                            onCustomEmojiSelect={handleEmoticonSelect}
 | 
			
		||||
                            requestClose={() => {
 | 
			
		||||
                              setAnchor(undefined);
 | 
			
		||||
                              if (!mobileOrTablet()) ReactEditor.focus(editor);
 | 
			
		||||
                              setAnchor((v) => {
 | 
			
		||||
                                if (v) {
 | 
			
		||||
                                  if (!mobileOrTablet()) ReactEditor.focus(editor);
 | 
			
		||||
                                  return undefined;
 | 
			
		||||
                                }
 | 
			
		||||
                                return v;
 | 
			
		||||
                              });
 | 
			
		||||
                            }}
 | 
			
		||||
                          />
 | 
			
		||||
                        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue