MCPcopy Create free account
hub / github.com/PatoSala/react-native-blocks / getTextInputProps

Function getTextInputProps

packages/core/src/hooks/useTextInput.ts:194–222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 10

CheckboxBlockFunction · 0.85
BulletBlockFunction · 0.85
CalloutBlockFunction · 0.85
CodeBlockFunction · 0.85
TextBlockFunction · 0.85
PageBlockFunction · 0.85
HeaderBlockFunction · 0.85
SubSubHeaderBlockFunction · 0.85
SubHeaderBlockFunction · 0.85
QuoteBlockFunction · 0.85

Calls 1

handleOnKeyPressFunction · 0.70

Tested by

no test coverage detected