Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add well known PortalTarget class and examples #334

Merged
merged 2 commits into from
May 3, 2024

Conversation

myieye
Copy link
Contributor

@myieye myieye commented May 3, 2024

Adds PortalTarget (as discussed) as a well known class that can be used to globally customize the default portal target used by the portal action.

I also:

  • Added examples of the different target approaches (see screenshot below)
  • Changed the portal logic to put the portal back in its original parent if it becomes disabled (rather than doing nothing)
    I expect this was just an oversight so far. If a portal is initially disabled, it just stays in its original parent, so it seems to make sense to consider that its "disabled state". And if a user doesn't want the portal to move, they just shouldn't change the options.
    I primarily made the change, because it meant that I needed less code for the examples, but I think that it's the intuitive behaviour.

image

Copy link

changeset-bot bot commented May 3, 2024

🦋 Changeset detected

Latest commit: d5e0ae0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte-ux Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-ux ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 1:34pm

Copy link
Owner

@techniq techniq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and I appreciate you adding examples to the docs, and I agree disabling should restore back to the original location, good catch. Let a few little nits then looks to merge.

packages/svelte-ux/src/lib/actions/portal.ts Outdated Show resolved Hide resolved
@techniq techniq merged commit a4acb88 into techniq:main May 3, 2024
2 checks passed
@techniq
Copy link
Owner

techniq commented May 3, 2024

Thanks @myieye!

@github-actions github-actions bot mentioned this pull request May 3, 2024
@myieye myieye deleted the feat/add-well-known-PortalTarget-class branch May 3, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants