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

onOpen and onClose event handlers for Select #5836

Closed
vishnuvardhan-s opened this issue Sep 21, 2022 · 9 comments · Fixed by #6398
Closed

onOpen and onClose event handlers for Select #5836

vishnuvardhan-s opened this issue Sep 21, 2022 · 9 comments · Fixed by #6398

Comments

@vishnuvardhan-s
Copy link

Is your feature request related to a problem? Please describe.
I have a use-case where I need to know if Select is open or not.

Describe the solution you'd like
Event handlers like onOpen and onClose

Describe alternatives you've considered
Passed an id to the Select say (select-id) and then used

document.getElementById('select-id')?.hasAttribute('opened')
@Lukas742
Copy link
Collaborator

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.

@Lukas742 Lukas742 transferred this issue from SAP/ui5-webcomponents-react Sep 21, 2022
@plamenivanov91
Copy link
Contributor

Hello @SAP/ui5-webcomponents-topic-p ,

The reporter wants new events called onOpen and onClose respectively when the Select is being opened/closed.

Currently this can be achieved if we listen for opened attribute change on the ui5-select tag/component with mutation observer.

Please decide whether or not this should be implemented.

Regards,
Plamen Ivanov

@scameron
Copy link
Contributor

I think this might be related to this other feature request for Menu:
#5095

Maybe they could be considered together...

@dobrinyonkov
Copy link
Contributor

Hi @scameron,

in order to continue with this feature request we would neee more information.
Could you please provide more details about your use case especially with the ui5-select component?

Thanks!
Dobrin

@scameron
Copy link
Contributor

Hi @dobrinyonkov,

You can refer to this issue for details about the use case, including screenshots of the behaviour we are trying to match: #5653.

There are comments near the bottom where @ilhan007 suggests a work-around that we want to try, but that work-around isn't possible unless we can detect the open/close state on the menu popover.

@dobrinyonkov
Copy link
Contributor

Hi @scameron,

as far as I see #5653 is about ui5-menu component and additional "toggled" state/styles for the button opener. This feature reuqest is about the ui5-select component which always has the same opener (the internal "textfield") and its opened/toggled state is highlighted according to the Fiori Specifications:

image

Please correct me if I'm missing something here.

Kind Regards,
Dobrin

@scameron
Copy link
Contributor

Hi @dobrinyonkov,

Yes, you're right, in our case we're not actually using Select, we're using Menu. When I saw this one I thought it looked the same as the feature request on the Menu side (#5095) so that it might make sense to consider these together.

If they are not related, apologies for the confusion. The one we need specifically for the workaround is the Menu.

Perhaps @vishnuvardhan-s can add something if there's another use case to consider more specifically for Select.

@vishnuvardhan-s
Copy link
Author

My case goes like this. The toolbar dropdown should not collapse when Select is opened, it should stay open. So, the solution for this would be to know if the Select is open and take decision based on it, whether to keep the toolbar open or not programatically.

I have attached a video of the scenario for better understanding

Select.issue.mov

@dobrinyonkov
Copy link
Contributor

Internal Reference: BGSOFUIPIRIN-6004

@dobrinyonkov dobrinyonkov added this to the 1.10.0 milestone Jan 13, 2023
@ilhan007 ilhan007 modified the milestones: 1.10.0, 1.11.0 Jan 25, 2023
plamenivanov91 added a commit to plamenivanov91/ui5-webcomponents that referenced this issue Feb 1, 2023
There are two new events 'open' and 'close' which are fired after
the dropdown's opening and closure respectively.

Implements SAP#5836
@plamenivanov91 plamenivanov91 linked a pull request Feb 1, 2023 that will close this issue
plamenivanov91 added a commit that referenced this issue Feb 3, 2023
* feat(ui5-select): new events introduced
There are two new events 'open' and 'close' which are fired after
the dropdown's opening and closure respectively.

FIXES: #5836
@petyabegovska petyabegovska moved this to Completed in Planning - Topic P Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

6 participants