inveniosoftware / invenio-search-js

Invenio-Search client library for building the web UI.
http://inveniosoftware.github.io/invenio-search-js/
Other
3 stars 23 forks source link

Select menu does not show the selected option #109

Closed Dinika closed 6 years ago

Dinika commented 6 years ago

When using the invenio-search-select-box directive the option that the user chooses in the 'Sort by' menu is not displayed in the select box as shown below screenshot from 2017-12-22 17-18-41

I believe this is because while we are setting the value attribute in the option tag as option.value, the option.value is getting modified from, say, -bestmatch to bestmatch (the dash is being removed) here.

I don't quite understand why the dash is being removed. When I tried running the code without removing the dash, it was running as expected and the selected option was getting rendered in the select box.

lnielsen commented 6 years ago

Ping @drjova

drjova commented 6 years ago

@lnielsen already working on it :)

lnielsen commented 6 years ago

Was this fixed? If not I'll include it in the upcoming Invenio sprint

drjova commented 6 years ago

actually it was a wrong sort configuration on our side

slint commented 6 years ago

@lnielsen @drjova Should this be closed? I guess the if there's anything to be done is to put some extra checking or default parameters so we could possibly add to prevent this from happening...

drjova commented 6 years ago

@slint this problem is connected with RECORDS_REST_SORT_OPTIONS. The way we sort things it's confusing because we have the sort option and the order option which are changing the same parameter.

Ideally we should have only the sort option which will include the order options. Like the following:

| Sort Options  ^ |
===================
| By Name (asc)   |
| --------------- |
| By Name (desc)  |
| --------------- |
| Older           |
| --------------- |
| Newer           |

IMO it doesn't worth to do any changes now since Invenio will change the UI framework soon.