Skip to content

Some components not working inside Dialog #1809

@Mil4n0r

Description

@Mil4n0r

Describe the bug

This bug seems to be related to #1515. The components that don't work as expected are Dropdown and Calendar.

  • Dropdown: When pressing up and down keys, the focus gets stuck in the last item, no matter what.
  • Calendar: When pressing it, it won't open.

It seems that the bug is related to the way focus events are handled, as both of those components are calling element.focus() at the same time as the FocusLock

To Reproduce

Example:

  1. Create a new React app using Vite.
  2. Install @dxc-technology\halstack-react package.
  3. Put DxcDropdown or DxcCalendar inside a DxcDialog
  4. Interact with the component inside the DxcDialog

Expected behaviour
Both components must work the same way they do when they are outside of a Dialog

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjiraThis task is referenced in a story of Jira

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions