sap.m.SearchField clear is running the search
See original GitHub issueI’m using the sap.m.SearchField. When I click the (x) icon, it actually executes the search. Same result if I run the .clear() method on the control (which is not a documented method though).
I checked the control source, and it seems to be the intentional behaviour. But it seems odd to me and to my users.
sap.m.SearchField.prototype.clear = function(){
if(!this._inputElement || this.getValue() == "") return;
this.setValue("");
this.fireLiveChange({newValue: ""});
this.fireSearch({query: ""}); // <-----------why?
};
Currently I override the method in my controller as a workaround.
Issue Analytics
- State:
- Created 10 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
sap.m.SearchField - API Reference - Demo Kit - SAPUI5 SDK
An input field to search for a specific item. Overview. A search field is needed when the user needs to find specific information...
Read more >SearchField search or close button not triggering
Hi, I am using sap.m.searchfield in my xml view and trying to perform ... Search Press/Enter onSearch: function(oEvent) { // Catching Clear ......
Read more >Search | SAP Fiori Design Guidelines
Use a search field ( sap.m.SearchField ) if you want to enable users to enter text to search for information. The search field...
Read more >How to clear input field value on back - SAP Community
We can set empty value to the input fields when click on back button. ... check in the inspect element of chrome, by...
Read more >How to clear/reset data in sap.ui.commons.searchfield
searchfield " control in "sap.ui.commons.dropdownbox" change event. I have tried below option but i am not able to succeed here. this.byId(" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We recently upgraded to UI5 1.50 and found that there is now a ‘clearButtonPressed’ parameter passed on the search event callback. And it’s documented too, so this is exactly what we needed and this issue can be closed. Thanks!
This enhancement is already implemented with release 1.34. Therefore, closing this issue.