()
| 192 | } |
| 193 | |
| 194 | const getTextInputProps : () => TextInputProps = () => { |
| 195 | return { |
| 196 | ref: inputRef, |
| 197 | defaultValue: valueRef.current, |
| 198 | /** Disable multiline text input scrolling. */ |
| 199 | scrollEnabled: false, |
| 200 | multiline: true, |
| 201 | selectionColor: "black", |
| 202 | /** Prevents keyboard from flickering when focusing a new block. */ |
| 203 | submitBehavior: "submit", |
| 204 | selectTextOnFocus: false, |
| 205 | smartInsertDelete: false, |
| 206 | /** Prevents the text input being accidentally focused when scrolling/moving a block. */ |
| 207 | editable: isEditable, |
| 208 | |
| 209 | onSelectionChange: handleSelectionChange, |
| 210 | showSoftInputOnFocus: showSoftInputOnFocus, |
| 211 | onChangeText: handleChangeText, |
| 212 | onBlur: handleOnBlur, |
| 213 | onFocus: handleOnFocus, |
| 214 | onSubmitEditing: handleSubmitEditing, |
| 215 | onKeyPress: (event) => { |
| 216 | if (event.nativeEvent.key === "Backspace" && selectionRef.current.start === 0 && selectionRef.current.end === 0) { |
| 217 | handleOnKeyPress(event); |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | React.useEffect(() => { |
| 225 | if (inputRef.current) { |
no test coverage detected