Repository navigation
feat(website): add sampleapp demo in playground - #25
Merged
Merged
Conversation
… playground The playground iframe runs in a separate JS realm, causing `el instanceof HTMLElement` to throw in UI5ElementMetadata.validateSlotValue when ShellBar processes its slotted children — each realm has its own HTMLElement constructor. Fix by copying @ui5/webcomponents-base locally and patching UI5ElementMetadata.js to use nodeType checks instead of instanceof for HTMLElement/Node slot validation. Update the playground import map to serve @ui5/webcomponents-base from local-cdn. Also adds the full sampleapp demo (airports map with ShellBar, filters, fly-to, distance measurement, selection controls) and fixes two bugs in the sample: - ShellBar logo: replace inline <svg> (SVGElement, not HTMLElement) with <img> - Fly-to: read combobox selection at click time to avoid stale coords from change event firing after goToBtn click
dobromiraboycheva
approved these changes
Oct 12, 2026
|
🎉 This PR is included in version 0.1.0 🎉 The release is available on npm and GitHub releases. |
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
el instanceof HTMLElementthrows inUI5ElementMetadata.validateSlotValuewhen ShellBar processes slotted children (each realm has its ownHTMLElementconstructor). Fixed by copying@ui5/webcomponents-baseintolocal-cdnand patchingUI5ElementMetadata.jsto usenodeTypechecks instead ofinstanceofforHTMLElement/Nodeslot types. The playground import map is updated to serve@ui5/webcomponents-basefrom local-cdn instead of jsDelivr CDN.<svg>(anSVGElement, not anHTMLElement) with<img>so it passes slot type validation.goToBtnclick handler was readingflyToDestCoordscached by thechangeevent, which fires after the button click when the user picks from the dropdown and immediately clicks Go. Fixed by reading the combobox selection directly inside the click handler.Test plan
node website/build-scripts/local-cdn.mjsand verifylocal-cdn/ui5-base/dist/UI5ElementMetadata.jscontainsisValidSlotTypecd website && npm start) and open the sampleapp sample pageThe element is not of type HTMLElementerror in the console