-
Notifications
You must be signed in to change notification settings - Fork 253
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
refactor(ui5-input): replace openPicker method with public property open #8950
Conversation
BREAKING CHANGE: Remove openPicker method and replace it with public property open Before the ui5-input suggestions popover could be opened by calling `openPicker()` : ```js const input = document.getElementById("exampleID"); input.openPicker(); ``` Now the suggestions popover is opened by setting the `open` property to true: ```js const input = document.getElementById("exampleID"); input.open = true; ```
I know this is still WIP, but adding a public
|
Method openPicker of **ui5-input** is replaced with public property `open` BREAKING CHANGE: Method `openPicker` is removed and replaced with public property `open`. Before, the ui5-input suggestions picker could be opened by calling `openPicker()` : ```js const input = document.getElementById("exampleID"); input.openPicker(); ``` Now the suggestions picker is opened by setting the `open` property to true: ```js const input = document.getElementById("exampleID"); input.open = true; ``` You can now close the suggestions picker setting the `open` property to false: ```js const input = document.getElementById("exampleID"); input.open = false; ``` When the suggestion picker opens or closes internally, **open** and **close** events are fired. You can listen for those events like this: ```js const input = document.getElementById("exampleID"); input.addEventListener("open", (event) => {}); input.addEventListener("close", (event) => {}); ``` Related to: #8461
…into input-open
…into input-open
…into input-open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I am an app and set open=true, but no suggestions are loaded it will currently show an empty popover. I think that we were discussing for one of the input components that we do not want this. Can you research if we have some additional logic in the other inputs regarding this? I am not sure if the discussion was regarding UI5 or the components.
- In the sample "Input with open suggestions on focusin" if I click to open the dialog on mobile I am unable to close it. Even if I filter to show an item and click it, the suggestions are not closed.
@@ -425,6 +439,16 @@ class Input extends UI5Element implements SuggestionComponent, IFormInputElement | |||
@property({ type: Boolean }) | |||
showClearIcon!: boolean; | |||
|
|||
/** | |||
* Defines whether the suggestions picker is open. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you discussed with the central team what will be the behavior in a ui5-input is set to open and it is outside the viewport? Should we add additional comments here explaining the behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have discussed that for now this is the expected behavior - if the input is outside the viewport its suggestions picker will be closed, as far as the component fires an event to notify the users that the suggestions picker is closed.
|
Method openPicker of `ui5-input` is replaced with public property `open` **BREAKING CHANGE**: Removed `openPicker` method and replaced it with public property `open`
…into input-open
Method openPicker of
ui5-input
is replaced with public propertyopen
BREAKING CHANGE: Removed
openPicker
method and replaced it with public propertyopen
Before, the ui5-input suggestions picker could be opened by calling
openPicker()
:Now the suggestions picker is opened by setting the
open
property to true:You can now close the suggestions picker setting the
open
property to false:When the suggestion picker opens or closes internally,
open
andclose
events are fired. You can listen for those events like this:Related to: #8461