SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.52k stars 263 forks source link

ShellBar: Magnifier-Button toggles searchField, but doesn't trigger a search #6273

Closed MetalCar closed 2 months ago

MetalCar commented 1 year ago

Issue Description

Is it right, that that magnifier button only toggles the searchField? Is it possible to change this behaviour, that when something is entered in the searchfield that the search will be triggered?

https://github.com/SAP/ui5-webcomponents-react/issues/3982

kineticjs commented 1 year ago

Hi @MetalCar,

You know that by design the app provides the ui5-input component to be used for the search (i.e. sets it to the "searchField" slot of the ShellBar) So the app can already use the existing ui5-input API to add a listener for the inputs change/input events => can trigger a search when something is entered in the searchfield. Or did you mean something else?

MetalCar commented 1 year ago

We are using the React-Components of UI5. I already opened an issue there, but they refer me to this repository. I have a ShellBar on top of my application. The ShellBar offers a property called searchField. I can assign an Input to this searchField, so that input will be rendered in the ShellBar, but with an additional IconButton with a magnifier on it. When i click on this magnifier icon button, then the only behaviour of this button is, to toggle that input, that i entered into the searchField-property. In the following, my example Code of our ShellBar (but it's react)

<ShellBar
    searchField={
      <>
          <Input
            ref={searchField}
            showClearIcon={true}
            onKeyUp={handleChange}
          />
      </>
    }
  >

And I also attached an image to describe what i mean. All what I want is, to change the behavoiur of that magnifier button, but it comes automatically through the searchField-Property. image

kineticjs commented 1 year ago

Hi @MetalCar,

So you want the app to be notified whenever the user clicks the "magnifier" button in order to do some additional/different action, for example, prevent the hiding of the search field and instead trigger a search for the entered term?

MetalCar commented 1 year ago

That's exactly what I want todo!

ndeshev commented 1 year ago

Hello @SAP/ui5-webcomponents-topic-p, could you please take a look of this feature request to provide an event for search icon click similar to the one that the profile icon has.

dobrinyonkov commented 1 year ago

Internal reference: BGSOFUIPIRIN-6076

dobrinyonkov commented 2 months ago

Closed with https://github.com/SAP/ui5-webcomponents/pull/8197