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

select menu does not close when changing tabs #974

Closed
JuliusRuppert opened this issue Nov 13, 2024 · 0 comments
Closed

select menu does not close when changing tabs #974

JuliusRuppert opened this issue Nov 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Milestone

Comments

@JuliusRuppert
Copy link

Describe the bug
When having a select menu opened and then click on another tab, the select menu does not close automatically. Same beaviour applies on the domino-ui demo page when opening a select menu and then clicking on an expand icon of a card.

To Reproduce
Steps to reproduce the behavior (Tabs example):

  1. run attached code
  2. click on the select in a tab
  3. change tab by clicking on the other tab
  4. The select menu will not close automatically

Steps to reproduce the behavior (Collapse Icon of Cards) :

  1. Go to domino-ui demo page
  2. Click on any enabled select
  3. Click on any expand icon of a card
  4. The select menu will not close automatically

Expected behavior
A select menu should be closed if you click anywhere other than in the menu.

Screenshots
Example with tabs
domino-ui-select-does-not-close-tabs gif

Domino-UI Demo
domino-ui-select-does-not-close gif

Additional context

import com.google.gwt.core.client.EntryPoint;
import org.dominokit.domino.ui.forms.suggest.Select;
import org.dominokit.domino.ui.forms.suggest.SelectOption;
import org.dominokit.domino.ui.forms.TextBox;
import org.dominokit.domino.ui.grid.Column;
import org.dominokit.domino.ui.layout.AppLayout;
import org.dominokit.domino.ui.notifications.Notification;
import org.dominokit.domino.ui.tabs.Tab;
import org.dominokit.domino.ui.tabs.TabsPanel;
import static org.dominokit.domino.ui.utils.Domino.body;

public class SelectTest implements EntryPoint {
    @Override
    public void onModuleLoad() {

        AppLayout layout = AppLayout.create("select with tabs").show();
        layout.withContent((parent, element) -> {
            element.appendChild(
                    TabsPanel.create()
                            .appendChild(
                                    Tab.create("Tab1")
                                            .appendChild(craeateSampleSelect("Country-TAB1"))
                            )
                            .appendChild(
                                    Tab.create("Tab2")
                                            .appendChild(TextBox.create("some text ..."))
                                            .appendChild(craeateSampleSelect("Country-TAB2"))
                            )
            );
        });
        body().appendChild(layout);
    }

    private static Column craeateSampleSelect(String name) {
        return Column.span6()
                .appendChild(
                        Select.<String>create(name)
                                .setSearchable(true)
                                .appendChild(
                                        SelectOption.create(
                                                        "nothing", "nothing", "-- please select --")
                                                .setSearchable(false))
                                .appendChild(SelectOption.create("USA", "USA", "America (USA)"))
                                .appendChild(SelectOption.create("ARG", "ARG", "Argentina"))
                                .appendChild(SelectOption.create("BRA", "BRA", "Brazil"))
                                .appendChild(SelectOption.create("DEN", "DEN", "Denmark"))
                                .appendChild(SelectOption.create("CRO", "CRO", "Croatia"))
                                .appendChild(SelectOption.create("IND", "IND", "India"))
                                .appendChild(SelectOption.create("SPA", "SPA", "Spain"))
                                .appendChild(SelectOption.create("FRA", "FRA", "France"))
                                .appendChild(SelectOption.create("JOR", "JOR", "Jordan"))
                                .selectAt(0)
                                .addChangeListener(
                                        (oldValue, newValue) -> {
                                            Notification.create("Item selected [ " + newValue + " ]")
                                                    .show();
                                        })
                );
    }
}
@vegegoku vegegoku self-assigned this Dec 22, 2024
@vegegoku vegegoku added the bug Something isn't working label Dec 22, 2024
@github-project-automation github-project-automation bot moved this to To do in Domino UI Dec 22, 2024
@vegegoku vegegoku added this to the 2.0.4 milestone Dec 22, 2024
@vegegoku vegegoku changed the title v2 select menu does not close when changing tabs select menu does not close when changing tabs Dec 22, 2024
@vegegoku vegegoku added the version 2.x.x Version 2.x.x issues label Dec 22, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in Domino UI Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Projects
Status: Done
Development

No branches or pull requests

2 participants