Skip to content

onBlur not called as expected #184

@andrewcoelho

Description

@andrewcoelho

Describe the bug
onBlur doesn't work when tapping on ScrollView which prevents keyboard from being dismissed

To Reproduce
Default TextInput component works:

export default function Page() {
  const insets = useSafeAreaInsets();

  return (
    <View style={{ flex: 1 }}>
      <ScrollView>
        <View style={{ flex: 1 }} />
      </ScrollView>
      <View style={{ paddingBottom: insets.bottom }}>
        <TextInput
          placeholder="Enter your message"
          onBlur={() => {
            console.log('onBlur'); // fires as expected
          }}
        />
      </View>
    </View>
  );
}

EnrichedTextInput does not work:

export default function Page() {
  const insets = useSafeAreaInsets();

  return (
    <View style={{ flex: 1 }}>
      <ScrollView>
        <View style={{ flex: 1 }} />
      </ScrollView>
      <View style={{ paddingBottom: insets.bottom }}>
        <EnrichedTextInput
          placeholder="Enter your message"
          onBlur={() => {
            console.log('onBlur'); // never fires
          }}
        />
      </View>
    </View>
  );
}

Expected behavior
It should behave the same as TextInput so that integrating with ScrollView works as expected

Screenshots
If applicable, add screenshots to help explain your problem.

Device (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions