@@ -83,6 +83,8 @@ type Props = {
8383 debugChatScroll ?: boolean
8484 getPingComplete ?: ( value : string ) => Promise < string [ ] >
8585 currentPlayerName ?: string
86+ spellCheckEnabled ?: boolean
87+ onSpellCheckEnabledChange ?: ( enabled : boolean ) => void
8688}
8789
8890export const chatInputValueGlobal = proxy ( {
@@ -103,7 +105,9 @@ export default ({
103105 chatVanillaRestrictions,
104106 debugChatScroll,
105107 getPingComplete,
106- currentPlayerName
108+ currentPlayerName,
109+ spellCheckEnabled = false ,
110+ onSpellCheckEnabledChange
107111} : Props ) => {
108112 const playerNameValidated = useMemo ( ( ) => {
109113 if ( ! / ^ [ \w \d _ ] + $ / i. test ( currentPlayerName ?? '' ) ) return ''
@@ -112,7 +116,6 @@ export default ({
112116
113117 const sendHistoryRef = useRef ( JSON . parse ( window . sessionStorage . chatHistory || '[]' ) )
114118 const [ isInputFocused , setIsInputFocused ] = useState ( false )
115- const [ spellCheckEnabled , setSpellCheckEnabled ] = useState ( false )
116119 const [ preservedInputValue , setPreservedInputValue ] = useState ( '' )
117120 const [ inputKey , setInputKey ] = useState ( 0 )
118121 const pingHistoryRef = useRef ( JSON . parse ( window . localStorage . pingHistory || '[]' ) )
@@ -458,7 +461,7 @@ export default ({
458461 icon = { pixelartIcons [ 'text-wrap' ] }
459462 onClick = { ( ) => {
460463 setPreservedInputValue ( chatInput . current ?. value || '' )
461- setSpellCheckEnabled ( ! spellCheckEnabled )
464+ onSpellCheckEnabledChange ?. ( ! spellCheckEnabled )
462465 remountInput ( )
463466 } }
464467 />
0 commit comments