Fix Firefox not updating spellcheck language in textarea (#35148)
This commit is contained in:
		@@ -162,6 +162,14 @@ const AutosuggestTextarea = forwardRef(({
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }, [suggestions, textareaRef, setSuggestionsHidden]);
 | 
					  }, [suggestions, textareaRef, setSuggestionsHidden]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hack to force Firefox to change language in autocorrect
 | 
				
			||||||
 | 
					  useEffect(() => {
 | 
				
			||||||
 | 
					    if (lang && textareaRef.current && textareaRef.current === document.activeElement) {
 | 
				
			||||||
 | 
					      textareaRef.current.blur();
 | 
				
			||||||
 | 
					      textareaRef.current.focus();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }, [lang]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const renderSuggestion = (suggestion, i) => {
 | 
					  const renderSuggestion = (suggestion, i) => {
 | 
				
			||||||
    let inner, key;
 | 
					    let inner, key;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user