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

[React] IxDateDropdown null pointer after switching to custom range and back #1555

Open
2 tasks done
OG84 opened this issue Nov 9, 2024 · 1 comment
Open
2 tasks done
Labels
type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed

Comments

@OG84
Copy link

OG84 commented Nov 9, 2024

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

What happened?

When using the IxDateDropdown, there is some kind of null pointer exception when you do the following:

  • click the drop down button (to open it)
  • select "Custom ..."
  • click the drop down button (to close it)
  • click the drop down button (to open it)
  • select "Last 7 days"
  • click the drop down button (to close it)

This raises

Uncaught TypeError: Cannot read properties of undefined (reading 'isPresent')
    at DropdownController.dismiss (@siemens_ix-react.js?v=1f08deba:5141:18)
    at DropdownController.dismissChildren (@siemens_ix-react.js?v=1f08deba:5137:12)
    at DropdownController.dismiss (@siemens_ix-react.js?v=1f08deba:5142:12)
    at toggleController (@siemens_ix-react.js?v=1f08deba:5370:28)
    at Button2.<anonymous> (@siemens_ix-react.js?v=1f08deba:5376:9)

In production this will just log an error to the console, but in development this error will break the app due to the error message.

This not only happens when clicking the drop down button itself, but also when clicking outside the drop down.
Looks like there is some null check missing in the drop down controller.

Current workaround I'm using: unique key prop on the IxDateDropdown which consists of all dynamically provided props. So the Dropdown is unmounted and re-mounted whenever it's props change.

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

React

Which version of iX do you use?

v2.5.0

Code to produce this issue.

https://stackblitz.com/edit/tcjojk?file=src%2FApp.tsx

or

https://ix.siemens.io/docs/controls/date-dropdown/#with-user-defined-range-options
@OG84 OG84 added the triage We discuss this topic in our internal weekly label Nov 9, 2024
@OG84 OG84 changed the title IxDateDropdown null pointer after switching to custom range and back [React] IxDateDropdown null pointer after switching to custom range and back Nov 9, 2024
@matthiashader matthiashader added type: bug Something isn't working Workflow: Issue created JIRA issue is created and will be analyzed and removed triage We discuss this topic in our internal weekly labels Nov 14, 2024
Copy link
Contributor

github-actions bot commented Nov 14, 2024

🤖 Hello @OG84

Your issue will be analyzed and is part of our internal workflow.
To get informed about our workflow please checkout the Contributing Guidelines

JIRA: IX-1962

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 Workflow: Issue created JIRA issue is created and will be analyzed
Projects
None yet
Development

No branches or pull requests

2 participants