Closed arvalaan closed 9 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
solid-ui-components | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 18, 2023 4:49pm |
Thank you for that beautiful fix! 😁
📝 PR Description
This PR addresses the unexpected behaviour of the
CopyButton
component, ensuring that content copying occurs only when intended and the button state resets appropriately.Current Behaviour
CopyButton
component, their contents get copied immediately. This happens because thecreateEffect
runs without any delay or checks.Changes Made
createEffect
to run explicitly when theisCopied
signal changes. This ensures that copying happens at the intended time.deferred
prop set totrue
to prevent thecreateEffect
from running on the initial render.setInterval
is resetting theisCopied
signal, this ensures that the copy action only happens when it should.🚀 How to Test
CopyButton
component.CopyButton
and verify that the content is copied as expected.