[MOL-20560][NL] Add new event listeners-ready to location-field#576
[MOL-20560][NL] Add new event listeners-ready to location-field#576weili-govtech merged 6 commits intomainfrom
Conversation
|
shall we call it |
|
‘Mounted’ is a reasonable name, but it might suggest that it’s safe to dispatch the event as soon as the component mounts. In our case, there’s a short gap where the component is mounted but the listeners may not yet be fully registered (e.g., the show-location-modal listener is added in useEffect). The intent is to signal when the listeners are actually ready, so consumers know it’s safe to dispatch the event at that point. In case if we choose ‘mounted’, then we can add a comment to clarify this behavior. |
|
you have a point too, since we want to ensure |
| @@ -120,7 +120,7 @@ export class GeolocationPositionErrorWrapper extends Error { | |||
| /** fired after the location field registers its internal event listeners and is ready for external triggers */ | |||
There was a problem hiding this comment.
/** fired after the location field registers the `show-location-modal` event listener and is ready for external triggers */
Changes
In the new OS 2.0 enhancement, we need to display the location map immediately on page load in the mobile app. Normally, show-location-modal is triggered when the user clicks the location field, but now it runs on mount.
To support this, the location-field must register its show-location-modal event listener before the event is dispatched. This MR introduces a location-field listener-ready signal so consumers know when it’s safe to dispatch the event.
Changelog entry
Additional information