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

opened-changed event detail exposes opened state #2334

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

rajkeshwar
Copy link
Contributor

What I Did

  1. Replaced the Event with CustomEvent to include the opened state in the event's detail.
  2. The CustomEvent now also references the host element in its event target.

Note:

The opened-changed event previously lacked detail, and the event.target was null, making it impossible to determine the dialog's state within the event. This caused issues when attempting to control the dialog's state dynamically via the opened property.

A potential scenario is where a user dynamically triggers the dialog through the opened property, expecting to open or close the dialog accordingly. However, when the ESC key is pressed and the dialog closes, the state is not synced externally. As a result, the dialog might not reopen the next time the opened property is set to true.

By including { detail: { opened: true/false } }, it becomes possible to accurately determine the dialog's state and update the opened property externally, ensuring it remains in sync with the actual dialog state.

Copy link

changeset-bot bot commented Aug 19, 2024

🦋 Changeset detected

Latest commit: 980bc3f

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

This PR includes changesets to release 1 package
Name Type
@lion/ui 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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Rajkeshwar Prasad seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@gerjanvangeest
Copy link
Member

Hi @rajkeshwar thanks for the PR 💪!

  • Could you sign the CLA?
  • Can you run npm run changeset, to add the change to our changelog?
  • There is a linting issue, can you fix that?

@rajkeshwar
Copy link
Contributor Author

rajkeshwar commented Aug 22, 2024

Hi @rajkeshwar thanks for the PR 💪!

  • Could you sign the CLA?
  • Can you run npm run changeset, to add the change to our changelog?
  • There is a linting issue, can you fix that?

I have signed the CLA multiple times. The below text also says the same.

You have signed the CLA already but the status is still pending? Let us recheck it.

Here is the screenshot from https://cla-assistant.io/my-cla
cla-assistant-ing-bank

@gerjanvangeest gerjanvangeest merged commit e0ef676 into ing-bank:master Aug 22, 2024
6 of 7 checks passed
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