pnp / sp-dev-fx-controls-react

Reusable React controls for SPFx solutions
https://pnp.github.io/sp-dev-fx-controls-react/
MIT License
385 stars 381 forks source link

SPTermStorePickerService.js uses the absolute url of the pagecontext in version 3.19.0 of @pnp/spfx-controls-react #1893

Open DuaneBeis opened 1 month ago

DuaneBeis commented 1 month ago

Category

[ ] Enhancement

[x] Bug

[ ] Question

Version

Please specify what version of the library you are using: [ 3.19.0 ]

Expected / Desired Behavior / Question

When navigating from one tab on the left hand side navigation menu in modern teams to out webpart the behaviour should be the same as when selecting the item on first load of the site.

Currently, when selecting something like the Documents library and then navigating back to a page which contains the webpart an error is thrown because the absoluteUrl of the pagecontext is missing.

Observed Behavior

When selecting a quick navigation tab item and navigating back to the webpart items fail to load because the absoluteUrl of the page context is undefined.

Steps to Reproduce

Our webpart contains a legacy taxonomy picker. When selecting a document library and returning to the picker - default values are not shown and the picker doesn't load because of the following error: TypeError: Cannot read properties of undefined (reading 'web'). This has been traced to SPTermStorePickerService.js and the page context being modified upon navigation.

The only workaround appears to force a screen refresh on loading.

github-actions[bot] commented 1 month ago

Thank you for submitting your first issue to this project.