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

Conditional rendering for trigger button #3223

Conversation

phamduylong
Copy link
Contributor

Linked Issue

Closes #3206

Description

Only render button wrapping around trigger if the snippet was provided

Changsets

Instructions: Changesets automate our changelog. If you modify files in /packages, run pnpm changeset in the root of the monorepo, follow the prompts, then commit the markdown file. Changes that add features should be minor while chores and bugfixes should be patch. Please prefix the changeset message with feat:, bugfix: or chore:.

Checklist

Please read and apply all contribution requirements.

  • This PR targets the dev branch (NEVER master)
  • Documentation reflects all relevant changes
  • Branch is prefixed with: docs/, feat/, chore/, bugfix/
  • Ensure Svelte and Typescript linting is current - run pnpm ci:check
  • Ensure Prettier linting is current - run pnpm format
  • All test cases are passing - run pnpm test
  • Includes a changeset (if relevant; see above)

Copy link

changeset-bot bot commented Feb 16, 2025

🦋 Changeset detected

Latest commit: acef40d

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

This PR includes changesets to release 1 package
Name Type
@skeletonlabs/skeleton-svelte 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 Feb 16, 2025

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

Name Status Preview Updated (UTC)
skeleton-docs ❌ Failed (Inspect) Feb 16, 2025 3:38pm

Copy link

vercel bot commented Feb 16, 2025

@phamduylong is attempting to deploy a commit to the Skeleton Labs Team on Vercel.

A member of the Team first needs to authorize it.

@endigo9740 endigo9740 merged commit 56f1f3a into skeletonlabs:next Feb 16, 2025
5 of 7 checks passed
@phamduylong phamduylong deleted the bugfix/conditional-render-trigger-button branch February 16, 2025 18:54
@Hugos68
Copy link
Contributor

Hugos68 commented Feb 17, 2025

I know this has been closed, but just an observation, now that we wrap the snippet in a #if block, we can change: {@render trigger?.()} to {@render trigger()} because trigger will always be defined.

@phamduylong
Copy link
Contributor Author

I know this has been closed, but just an observation, now that we wrap the snippet in a #if block, we can change: {@render trigger?.()} to {@render trigger()} because trigger will always be defined.

I had that in mind, but then missed it during the refactoring. Thanks for the catch mate.

@phamduylong phamduylong mentioned this pull request Feb 17, 2025
7 tasks
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.

3 participants