Skip to content
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

[Feature Request]: Make group-item in combo box a container #7732

Closed
1 task done
yetian opened this issue Oct 20, 2023 · 6 comments
Closed
1 task done

[Feature Request]: Make group-item in combo box a container #7732

yetian opened this issue Oct 20, 2023 · 6 comments

Comments

@yetian
Copy link

yetian commented Oct 20, 2023

Feature Request Description

In the current documentation of the combo box component, the "Grouping" feature is defined in the following way:

<ui5-combobox placeholder="Grouping of items">
        <ui5-cb-group-item text="A"></ui5-cb-group-item>
        <ui5-cb-item text="Argentina"></ui5-cb-item>
        <ui5-cb-item text="Australia"></ui5-cb-item>	
        <ui5-cb-item text="Austria"></ui5-cb-item>	
        <ui5-cb-group-item text="B"></ui5-cb-group-item>
        <ui5-cb-item text="Bahrain"></ui5-cb-item>
        <ui5-cb-item text="Belgium"></ui5-cb-item>
        <ui5-cb-item text="Brazil"></ui5-cb-item>
        <ui5-cb-group-item text="C"></ui5-cb-group-item>
        <ui5-cb-item text="Canada"></ui5-cb-item>
        <ui5-cb-item text="Chile"></ui5-cb-item>
</ui5-combobox>

However, I couldn't find a way to figure out, without code injection, how I can generate dynamically grouped items, at least in Vue.

Proposed Solution

Instead of the current way of creating grouped items, I propose the following. Semantically and visually, it is also clear which items are in which groups.

<ui5-combobox placeholder="Grouping of items">
        <ui5-cb-group-item text="A">
                <ui5-cb-item text="Argentina"></ui5-cb-item>
                <ui5-cb-item text="Australia"></ui5-cb-item>	
                <ui5-cb-item text="Austria"></ui5-cb-item>	
        </ui5-cb-group-item>
        
        <ui5-cb-group-item text="B">
                <ui5-cb-item text="Bahrain"></ui5-cb-item>
                <ui5-cb-item text="Belgium"></ui5-cb-item>
                <ui5-cb-item text="Brazil"></ui5-cb-item>
        </ui5-cb-group-item>
        
        <ui5-cb-group-item text="C">
                <ui5-cb-item text="Canada"></ui5-cb-item>
                <ui5-cb-item text="Chile"></ui5-cb-item>
        </ui5-cb-group-item>    
</ui5-combobox>

In Vue, then I can generate the list dynamically:

<ui5-combobox placeholder="Grouping of items">
        <ui5-cb-group-item v-for="(group, index) in groups" :key="group_index" :text="group.name">
                <ui5-cb-item v-for="(item, item_index) in group" :key="item_index" :text="item.name"></ui5-cb-item>
        </ui5-cb-group-item>  
</ui5-combobox>

Proposed Alternatives

No response

Organization

No response

Additional Context

No response

Priority

Medium

Privacy Policy

  • I’m not disclosing any internal or sensitive information.
@yanaminkova
Copy link
Member

Hello @SAP/ui5-webcomponents-topic-rl,

Could you please have a look and consider this feature request regarding grouping of items in ui5-combobox?

Thanks and Kind regards,
Yana

@niyap
Copy link
Contributor

niyap commented Oct 22, 2023

Hello @SAP/ui5-webcomponents-topic-rl,

We have to analyse and discuss with designer, whether it is feasible to implement this approach?

Kind Regards,
Niya

@niyap niyap removed this from New Issues in Maintenance - Topic RL Oct 22, 2023
@niyap niyap added this to New in Planning - Topic RL via automation Oct 22, 2023
@yetian
Copy link
Author

yetian commented Oct 23, 2023

Thanks @niyap for the comment.

I would recommend this way since it is much clearer semantically and I think it is also how grouping is implemented in general. I found some examples in Vue and Angular:

Except for the modern frameworks, this is how a browser supports: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup?retiredLocale=de

Best regards
Ye

@yetian
Copy link
Author

yetian commented Oct 23, 2023

Hi @niyap ,

In addition to the coding part, I also noticed that at least in the documentation, the grouping feature is only available for Combo Box, but not for Select. Could you also ask the designers/developers if it makes sense to have the grouping feature for Select as well?

Thanks and cheers
Ye

@hristop
Copy link
Contributor

hristop commented Oct 26, 2023

Hi @yetian ,

After discussion with or architects we have decided that this is good candidate for v2.0 of the web-components (4460) as it is incompatible with the current implementation.

So for now we will have to reject it, but we will surely have this in mind when we plan the changes in 2.0.

Best Regards,
Hristo

@hristop hristop closed this as completed Oct 26, 2023
Planning - Topic RL automation moved this from New to Completed Oct 26, 2023
@hristop hristop self-assigned this Oct 26, 2023
@MapTo0 MapTo0 mentioned this issue Oct 26, 2023
29 tasks
@yetian
Copy link
Author

yetian commented Nov 4, 2023

Thanks @hristop! Look forward to v2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants