fix: use boolValue for hasPressListener prop
Description
Explicitly extracts the boolValue from the hasPressListener prop on RNMBXVectorSourceComponentView. This fixes an issue when running in New Architecture where all VectorSource layers are marked as touchable because hasPressListener is always true when bridged to Swift.
Functionally, this manifests as a bug wherein VectorSource components will incorrectly "capture" taps, even when no onPress handler is provided, also preventing the root MapView:onPress handler from firing.
Similar change as https://github.com/rnmapbox/maps/pull/3850. Fixes #3864.
Checklist
- [x] I've read
CONTRIBUTING.md - [x] I updated the doc/other generated code with running
yarn generatein the root folder - [x] I have tested the new feature on
/exampleapp.- [x] In V11 mode/ios
- [x] In New Architecture mode/ios
- [ ] In V11 mode/android
- [ ] In New Architecture mode/android
- [ ] I added/updated a sample - if a new feature was implemented (
/example)
Apologies. This looks like a duplicate of #3865. My search skills failed me. I'll leave this open for the maintainers to decide how to proceed.
Hi @chrisforerunner, thank you for this contribution! 🎉
This fix looks great and follows the same pattern as #3850. The explicit boolValue extraction is important for New Architecture compatibility, where bridged boolean values need to be properly unwrapped to avoid them always evaluating as truthy.
I can see you've:
- ✅ Applied the fix correctly by using
[hasPressListener boolValue] - ✅ Run
yarn generateas requested - ✅ Tested on iOS with both V11 and New Architecture modes
This should indeed fix #3864 where VectorSource components were incorrectly capturing taps even without an onPress handler.
The CI is currently not running on this PR. Could you please rebase your branch onto the latest main? This will allow the CI checks to run:
git fetch upstream main
git rebase upstream/main
git push --force-with-lease origin your-branch-name
Thank you again for catching and fixing this New Architecture compatibility issue! The change looks ready to merge once CI passes.
Closed by #3865