shinokada / svelte-5-ui-lib

A UI library crafted for Svelte 5: Runes
https://svelte-5-ui-lib.codewithshin.com
MIT License
104 stars 13 forks source link

bugfix: remove backdrop if the backdrop variable is set to false #30

Closed blazef104 closed 4 days ago

blazef104 commented 1 week ago

šŸ“‘ Description

The current drawer component puts a backdrop div in the page even if the backdrop is set to false. I believe that if the backdrop variable is false the most desirable behaviour would be to do not add the backdrop div at all. This new behaviour might be useful if the drawer is used in a page where the user is allowed to copy paste some information in from other elements in the page that would otherwise be inaccessible.

The current component behaviour might be desirable in some cases (e.g. I want to have a drawer with a transparent backdrop so that the page is visible but I want to prevent the user from interacting with anything else) however this can still be achieved by setting backdropClass="!bg-transparent" when using the component.

āœ… Checks

ā„¹ Additional Information

There are definitely multiple ways to achieve this. I think the one proposed in this PR might be the cleanest but I am happy to add an additional variable like addBackdrop: boolean if you prefer to maintain the current behaviour.

vercel[bot] commented 1 week ago

@blazef104 is attempting to deploy a commit to the Shinichi Okada's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ā†—ļøŽ

Name Status Preview Comments Updated (UTC)
svelte-5-ui-lib āœ… Ready (Inspect) Visit Preview šŸ’¬ Add feedback Nov 6, 2024 10:29am
blazef104 commented 4 days ago

Hey @shinokada any issues with merging this? Would you like me to add documentation or make any change?

shinokada commented 4 days ago

Thank you for your contribution.