siemens / ix

Siemens Industrial Experience is a design system for designers and developers, to consistently create the perfect digital experience for industrial software products.
https://ix.siemens.io/
MIT License
197 stars 65 forks source link

Clicking a entry in a dropdown, also triggers a click in the backdrop #1224

Closed Stefei closed 4 months ago

Stefei commented 5 months ago

Prerequisites

What happened?

Clicking a entry in a dropdown, will also trigger a click in the backdrop. This is a problem for us, because we use a modal that closes if the user clicks outside of the modal bounds.

What type of frontend framework are you seeing the problem on?

Angular, JavaScript

Which version of iX do you use?

v2.1.0

Code to produce this issue.

import { Component } from '@angular/core';

@Component({
  selector: 'app-example',
  template: `
    <div style="background-color:#ffffff; height: 1000px" onclick="console.log('backdrop clicked')">
    <ix-button #trigger>Open</ix-button>
    <ix-dropdown [ixDropdownTrigger]="trigger">
      <ix-dropdown-header label="Category"></ix-dropdown-header>
      <ix-dropdown-item label="Item 2"></ix-dropdown-item>
      <ix-dropdown-item label="Item 3"></ix-dropdown-item>
      <ix-dropdown-item label="Item 4"></ix-dropdown-item>
      <ix-divider></ix-divider>
      <ix-dropdown-item label="Item 5"></ix-dropdown-item>
    </ix-dropdown>
    </div>
  `,
})
export default class Dropdown {
}
danielleroux commented 4 months ago

Cannot reproduce this issue https://stackblitz.com/edit/uo4ucs-xcdfpm?file=src%2Fapp%2Fdropdown.ts

Screen Recording 2024-05-06 at 08 08 14

matthiashader commented 4 months ago

As this is a duplicate of #1229, this issue will be closed and further be discussed there.