Conversation
Use WithDefault<boolean, true> for rotateEnabled, zoomEnabled, scrollEnabled, and pitchEnabled in the Fabric spec. This ensures the Codegen-generated C++ Props struct defaults these fields to true, matching the Objective-C initialization in LuggMapView.mm. Previously, with plain `boolean` (C++ default: false), setting any of these props to false on initial render would not be detected as a change (false != false), leaving the ObjC cached value as YES and thus keeping the gesture enabled. Agent-Logs-Url: https://github.com/dacoto/maps/sessions/a1861844-41b6-489b-ae7c-8e8d1488182c Co-authored-by: dacoto <16915053+dacoto@users.noreply.github.com>
Contributor
Author
|
Closes #62 |
There was a problem hiding this comment.
Pull request overview
Fixes an iOS Fabric prop-diffing issue where rotateEnabled, zoomEnabled, scrollEnabled, and pitchEnabled could be silently ignored on first render due to mismatched Codegen (C++) vs native (ObjC) default values.
Changes:
- Updates the Fabric spec to declare the four gesture props as
WithDefault<boolean, true>so Codegen-generated C++ defaults align with native initialization. - Ensures first-render
updatePropscomparisons correctly detect...Enabled={false}and apply the expected gesture settings on iOS.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rotateEnabled={false}had no effect on iOS — the map could still be rotated freely.The same silent failure affected
zoomEnabled,scrollEnabled, andpitchEnabled.Root cause: The Fabric spec declared these as plain
boolean, so Codegen generatedC++ props with a default of
false. On first render,updatePropscompares incomingprops against the C++ default-constructed
LuggMapViewProps:The ObjC-side initialization (
_rotateEnabled = YES) was never overwritten.Fix: Declare the four gesture props with
WithDefault<boolean, true>in the Fabricspec so Codegen generates C++ defaults of
true, aligning with the ObjC initializationand making first-render change detection correct.
Type of Change
Test Plan
rotateEnabled={false}on aMapViewand verify the map cannot be rotated on iOS.zoomEnabled={false},scrollEnabled={false}, andpitchEnabled={false}.true) still allows all gestures freely.Screenshots / Videos
Checklist