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

[Feature Request]: Allow close DateRangePicker using code #3220

Open
2 tasks done
apisarev opened this issue Jan 26, 2025 · 1 comment
Open
2 tasks done

[Feature Request]: Allow close DateRangePicker using code #3220

apisarev opened this issue Jan 26, 2025 · 1 comment
Labels
enhancement New feature or request response-requested

Comments

@apisarev
Copy link

Description

DateRangePicker has no way to close the dropdown using code. There are a couple of scenarios where it is needed:

  1. When a user clicks outside the dropdown on an iFrame, the dropdown is not closed. This is a significant issue when most of the app is in an iFrame.
  2. When DateRangePicker becomes disabled while the dropdown is opened. The dropdown stays open while the trigger button is disabled, and the user can apply a new range.

The issue might be valid for other controls with a dropdown.

Code of Conduct

@apisarev apisarev added the enhancement New feature or request label Jan 26, 2025
@Al-Dani
Copy link
Member

Al-Dani commented Apr 2, 2025

Hello @apisarev ,
We apologies for not responding to you question in time!

  1. That is something that our components with dropdowns should handle on blur. I couldn't easily reproduce the issue (date range picket dropdown got closed as expected), but we will look deeper. Did you check, if the issue happens for you for Select or Autosuggest components?

There is a work around, which isn't ideal, but can be a short-term fix. You can assign a key to the dropdown and reset it when clicking outside of the iFrame. That will trigger re-render and dropdown will be closed.

  1. Disabling or changing controls when users are editing them is a design anti-pattern and creates a poor user experience. We discourage such behaviour.

That said, we do not have enough data to expose close() method for the dropdowns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request response-requested
Projects
None yet
Development

No branches or pull requests

3 participants