You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix!: resolve issue #305 where looping could happen in typical declarative implementations
Removes a failure mode possible in React and others when handling error events. A fetch error from `<gmpx-place-overview>`, when caught, can result in the framework re-assigning the `place` property, triggering an infinite re-render loop. This change restores diff checking to the `place` property and implements regression tests.
BREAKING CHANGE: If you rely on setting `elem.place = elem.place` to force a refresh, you will need to switch to a new, explicit `.refresh()` method.
PiperOrigin-RevId: 972823989
|`auto-fetch-disabled`|`autoFetchDisabled`|`boolean`| If `place` is provided with a `Place` or `PlaceResult` instance, but does not contain fields required by child components, this element will make a request to the Place API to retrieve the missing data. Set `auto-fetch-disabled` to prevent the component from performing these requests. |`false`| ✅ |
34
-
|`fields`|`fields`|`string[] \| undefined`| Manually specify the fields to request from the Places API.<br/><br/>If unspecified, the component will request only fields used by child components. || ✅ |
35
-
|`place`|`place`|`string\|Place\|PlaceResult \| undefined`| The place to be displayed by this component. Provide a [Place ID](https://developers.google.com/maps/documentation/places/web-service/place-id?utm_source=github&utm_medium=documentation&utm_campaign=&utm_content=web_components) as a string to have the component look up and display details from the Place API. The component will not make further API requests if child components are added at a later time. If required, explicitly request a data fetch by re-setting `place` to the same Place ID as before.<br/><br/>Alternatively, assign a `Place` or `PlaceResult` object to the `place` property to render it directly (note that the attribute, on the other hand, only accepts a Place ID string). || ❌ |
|`auto-fetch-disabled`|`autoFetchDisabled`|`boolean`| If `place` is provided with a `Place` or `PlaceResult` instance, but does not contain fields required by child components, this element will make a request to the Place API to retrieve the missing data. Set `auto-fetch-disabled` to prevent the component from performing these requests. |`false`| ✅ |
34
+
|`fields`|`fields`|`string[] \| undefined`| Manually specify the fields to request from the Places API.<br/><br/>If unspecified, the component will request only fields used by child components. || ✅ |
35
+
|`place`|`place`|`string\|Place\|PlaceResult \| undefined`| The place to be displayed by this component. Provide a [Place ID](https://developers.google.com/maps/documentation/places/web-service/place-id?utm_source=github&utm_medium=documentation&utm_campaign=&utm_content=web_components) as a string to have the component look up and display details from the Place API. The component will not make further API requests if child components are added at a later time. If required, explicitly request a data fetch by calling `refresh()`.<br/><br/>Alternatively, assign a `Place` or `PlaceResult` object to the `place` property to render it directly (note that the attribute, on the other hand, only accepts a Place ID string). || ❌ |
36
36
37
37
## Slots
38
38
@@ -44,6 +44,14 @@ This component uses [named slots](https://developer.mozilla.org/en-US/docs/Web/A
44
44
| initial-loading | If specified, display this content when the component is initially loading Places data. Content in this slot will receive Places data, but some or all fields may be undefined. |
45
45
| error | If specified, display this content when there was any error loading data from the Places API. |
46
46
47
+
## Methods
48
+
49
+
### `refresh()`
50
+
51
+
Re-queries the set of consumed fields and re-fetches place data.
0 commit comments