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

[Bug]: select in dialog closes dialog #3189

Open
3 tasks done
patrickblanc opened this issue Nov 1, 2024 · 2 comments
Open
3 tasks done

[Bug]: select in dialog closes dialog #3189

patrickblanc opened this issue Nov 1, 2024 · 2 comments
Labels
type: bug 🐛 Something isn't working

Comments

@patrickblanc
Copy link

Preflight Checklist

Bug type

Functionality

It affects the following packages

Components

Which version of Lyne Components are you using

1.14.0

Operating system

Windows 10

Browser / Browser version

Edge Version 130.0.2849.56 (Version officielle) (64 bits)

Input mode

Mouse/Keyboard

Additional settings

No response

What happened?

msedge_RM3sIH5YnP.mp4

I have a typescript application where i am using the latest npm lyne package.

I have a react functional component

import { SbbButton } from '@sbb-esta/lyne-react/button'
import { SbbDialog, SbbDialogContent, SbbDialogTitle } from '@sbb-esta/lyne-react/dialog'
import { SbbOption } from '@sbb-esta/lyne-react/option'
import { SbbSelect } from '@sbb-esta/lyne-react/select'

export const MyComp = () => {
return <>
      <SbbButton
        onClick={ev => {
          const dialog = document.getElementById('dialog') as unknown as {
            open: (event: React.MouseEvent<any, MouseEvent>) => void
          }
          dialog.open(ev)
        }}
      />
      <SbbDialog
        id="dialog"
        title="title"
        backdropAction="none"
        onDidClose={() => {
          alert('onDidClose')
        }}
      >
        <SbbDialogTitle level="2">title</SbbDialogTitle>
        <SbbDialogContent>
          <form>
            <SbbFormField>
              <label>{i18n.wareGroup.title}</label>
              <SbbSelect placeholder="Dropdown">
                <SbbOption value="dada">dada</SbbOption>
              </SbbSelect>
            </SbbFormField>
          </form>
        </SbbDialogContent>
      </SbbDialog>
</>
}

My problem is that when i select the SbbSelect field and select an option or even if i don't but just get out of the SbbSelect field (see the video), then the onDidClose event of the Dialog is fired (you see the alert message)

Steps to reproduce the issue

  1. I gave you a React component to reproduce the issue

Relevant log output

No response

@jeripeierSBB
Copy link
Contributor

so far not reproducible. Contacted @patrickblanc via Teams.

@jeripeierSBB jeripeierSBB changed the title [Bug]: [Bug]: select in dialog closes dialog Nov 4, 2024
@jeripeierSBB
Copy link
Contributor

potentially solved with version 2.0 where the didOpen / didClose events don't bubble anymore. @patrickblanc can you please leave some feedback? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Development

No branches or pull requests

2 participants