toss / overlay-kit

The simplest and most intuitive way to manage overlays in React.
https://overlay-kit.slash.page
MIT License
295 stars 30 forks source link

Fix: Update 'current' to Reflect Last Overlay When Closing Intermediate Overlays #50

Closed jungpaeng closed 4 months ago

jungpaeng commented 4 months ago

Description

This PR addresses an issue where the 'current' overlay does not update to the last overlay when an intermediate overlay is closed. This behavior can lead to inconsistencies in the UI state.

Changes

Motivation and Context

The previous implementation did not account for scenarios where closing an intermediate overlay should update the 'current' overlay to reflect the last one in the order. This fix ensures that the 'current' overlay always points to the last opened overlay, maintaining consistent UI behavior.

How Will This Be Tested?

Related Issues

Fixes #44

Types of changes

Checklist

vercel[bot] commented 4 months ago

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

Name Status Preview Comments Updated (UTC)
overlay-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 13, 2024 5:34pm
changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: 66441ee2f7b6d2fd15450a3384daec1f70b5b197

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

This PR includes changesets to release 2 packages | Name | Type | | -------------------------- | ----- | | overlay-kit | Patch | | @overlay-kit/framer-motion | 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

jgjgill commented 4 months ago

Oh, thanks for the thorough check. 😂