Closed christophemenager closed 3 weeks ago
Hey @christophemenager
Can you post a minimal reproduction code, please? I've used this code:
export default function AwareScrollView({ navigation }: Props) {
return (
<>
<ScrollView style={{flex: 1,}} contentContainerStyle={{paddingLeft: 100, flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "red"}}>
<TextInput
key={1}
placeholder={`TextInput#${1}`}
keyboardType={1 % 2 === 0 ? "numeric" : "default"}
multiline={false}
onFocus={() => console.log("onFocus")}
onBlur={() => console.log("onBlur")}
style={{borderWidth: 2, borderColor: "black"}}
/>
</ScrollView>
</>
);
}
But it always calls onFocus
/onBlur
whenever I press on input/press outside:
LOG onFocus
LOG onBlur
LOG onFocus
LOG onBlur
LOG onFocus
LOG onBlur
LOG onFocus
LOG onBlur
I tested in RN 0.74 - do you think it makes a difference?
I also tested RN 0.73.4 (old architecture) - still everything works okay 🤷♂️ Guess something wrong with my code that I'm using 🤔
@christophemenager I've also tested on iPhone 6s (iOS 15.8) and I can not reproduce this problem in example app (I used Toolbar screen as example).
May I ask you to test my example app and maybe perform some code modifications to show how it can be reproduced?
The issue seems to be quite critical, so I want to fix it ASAP, but I can not reproduce it 😔
Please, don't ignore me 🙏
Sorry I am a bit busy this week, can I get back to you next Monday? I will try to give you a minimal repro code :)
Sorry I am a bit busy this week, can I get back to you next Monday?
Yeah, sure, take your time 👍
I will try to give you a minimal repro code :)
Thank you ❤️
Hi there! Sorry for the delay.
I tried to reproduce in an isolated react-native environment but I could not.
I guess it must be very specific to my setup, so I will close this issue and reopen it if I find a way to reproduce it properly.
@christophemenager yes, feel free to re-open this 👍
In 1.12 version I started to inject my own delegate to intercept some events that are available only on delegate level. So I guess in some scenarios delegate substitution doesn't work properly, so it would be good if you could figure out and provide a repro 🙏
Describe the bug
onFocus
is only called once, and not if text input is re-focusedonBlur
eventTo Reproduce Steps to reproduce the behavior:
Expected behavior onFocus and onBlur events should be called everytime the input is focused or blurred
Smartphone (please complete the following information):
Additional context This regression has been introduced in 1.12, 1.11 is working fine