Skip to content

Conversation

@ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Nov 14, 2025

when instantiating ms-select with option { isOpen: true }, we delay the opening of the drop by a CPU cycle. However the issue is that the initContainer() has a click event listener on the document.body and when { isOpen: true } is provided, it triggers the click event (not really sure why but it doesn't really matter) and the bug is that we should allow the close() and options.onClose() to be called only if the drop is really open (and it's not opened until the CPU cycle delay, so we need another internal _isOpen variable to reference and with that in place the close isn't being called anymore when we first open originally open the drop)

This fixes an issue identified in Slickgrid-Universal were it was calling the options.onClose() when creating and opening the drop... so with the fix in place, it no longer calls the onClose() on the original drop opening.

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link

Playwright E2E Test Results

83 tests  ±0   83 ✅ ±0   1m 44s ⏱️ -4s
73 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 6167ac9. ± Comparison against base commit 25091b4.

@ghiscoding ghiscoding changed the title fix: close() and onClose() functions should only be called w/open drop fix: close() fn and options.onClose() should only be called w/open drop Nov 14, 2025
@ghiscoding ghiscoding merged commit 4421718 into main Nov 14, 2025
7 checks passed
@ghiscoding ghiscoding deleted the bugfix/close-only-when-open branch November 14, 2025 00:55
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