Skip to content

[ViewSettingsDialog | ui5-webcomponents] onConfirmEvent uses filter item text as key: #7579

@22shubham22

Description

@22shubham22

Bug Description

Whenever filter items are selected inside ViewSettingsDialog and OK button is pressed an event is fired in which we see that there is key object pair ,

where key is -> text provided for filter item
object is -> an array of all the filter item options selected

We have give text as "Position" to the filter item ->

MicrosoftTeams-image (16)

and as you can see it appears in the view settings dialog

MicrosoftTeams-image (15)

Now when we select, any of the filter item options :

MicrosoftTeams-image (17)

and console log the event details :

MicrosoftTeams-image (19) MicrosoftTeams-image (18)

So basically in our code if we want to pickup the filters we do it by :

event.detail.filters[0]["Position"] ,
which seems fine if we just work with english , but in our project we support multiple languages, so when we change the language from english to french , then position gets translated to something else and then when pressed OK the event fired contain that translated text as key.

So, event.detail.filters[0]["Position"] this would not work anymore if we try to pick filters from the event, because now the text is translated .

Code Sandbox Link : https://codesandbox.io/s/ui5-webcomponents-forked-jxn5xt?file=/src/index.js

Affected Component

No response

Expected Behaviour

it'd be btter if the even generated would look for 'id' or 'key' as a first option rather than 'text'.

Isolated Example

No response

Steps to Reproduce

...

Log Output, Stack Trace or Screenshots

No response

Priority

Medium

UI5 Web Components Version

1.15.1

Browser

Chrome

Operating System

No response

Additional Context

"@ui5/webcomponents": "1.15.1",
"@ui5/webcomponents-base": "1.15.1",
"@ui5/webcomponents-fiori": "1.15.1",
"@ui5/webcomponents-icons": "1.15.1",
"@ui5/webcomponents-icons-business-suite": "1.15.1",
"@ui5/webcomponents-localization": "1.15.1",
"@ui5/webcomponents-react": "1.17.3",
"@ui5/webcomponents-theming": "1.15.1",

Organization

No response

Declaration

  • I’m not disclosing any internal or sensitive information.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Completed

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions