Fix for AutosizedTextarea not resetting height after clear on Android (#10927)
This commit is contained in:
@@ -34,7 +34,6 @@ import {
|
||||
} from '#/components/Autocomplete'
|
||||
import {
|
||||
AutosizedTextarea,
|
||||
type AutosizedTextareaHeightApi,
|
||||
type AutosizedTextareaProps,
|
||||
} from '#/components/forms/AutosizedTextarea'
|
||||
import {Span, Text} from '#/components/Typography'
|
||||
@@ -151,13 +150,6 @@ export function Composer({
|
||||
*/
|
||||
const inputScrollSharedValue = useSharedValue(0)
|
||||
|
||||
/*
|
||||
* Imperative handle on the underlying textarea, used to reset its height when
|
||||
* the input is cleared programmatically (Android doesn't fire
|
||||
* `onContentSizeChange` in that case).
|
||||
*/
|
||||
const heightApiRef = useRef<AutosizedTextareaHeightApi>(null)
|
||||
|
||||
/*
|
||||
* Expose imperative internal API
|
||||
*/
|
||||
@@ -168,7 +160,6 @@ export function Composer({
|
||||
clear: () => {
|
||||
tapper.inputProps.onChangeText('')
|
||||
inputScrollSharedValue.value = 0
|
||||
heightApiRef.current?.resetHeight()
|
||||
},
|
||||
insert: tapper.insert,
|
||||
setAutocompleteAnchor: sift.refs.setAnchor,
|
||||
@@ -330,7 +321,6 @@ export function Composer({
|
||||
</View>
|
||||
)}
|
||||
<AutosizedTextarea
|
||||
heightApiRef={heightApiRef}
|
||||
placeholderTextColor={t.palette.contrast_500}
|
||||
accessibilityLabel={label}
|
||||
accessibilityHint={label}
|
||||
@@ -356,6 +346,7 @@ export function Composer({
|
||||
{...tapper.inputProps}
|
||||
{...sift.targetProps}
|
||||
ref={mergeRefs([ref, tapper.inputProps.ref, sift.targetProps.ref])}
|
||||
rawValue={tapper.state.text}
|
||||
onBlur={e => {
|
||||
rest.onBlur?.(e)
|
||||
setActiveFacet(null)
|
||||
|
||||
Reference in New Issue
Block a user