Skip to content

TabSheet: Switching between tabs combobox's disabled state is reset #7518

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

Open
anasmi opened this issue May 27, 2025 · 1 comment
Open

TabSheet: Switching between tabs combobox's disabled state is reset #7518

anasmi opened this issue May 27, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation vaadin-tabsheet

Comments

@anasmi
Copy link
Contributor

anasmi commented May 27, 2025

Description

Added disabled combobox to a tabsheet and navigated to another tab. Switched back to the first and combobx became enabled.

Expected outcome

Combobox keeps its disabled states when switching between tabs

Minimal reproducible example

      TabSheet tabSheet = new TabSheet();
      tabSheet.add("Fist tab", comboBox);
      tabSheet.add("Second tab", button);
      button.setEnabled(false);
      comboBox.setEnabled(false);

Steps to reproduce

  1. Add snippet above into the code
  2. Observe combobox is disabled
  3. Click to the "Second tab"
  4. Navigate back to the "First tab"
  5. Combobox is enabled

Environment

Vaadin version(s): latest
OS: Windows

Browsers

Chrome, Firefox

@sissbruecker
Copy link
Contributor

That behavior is intentional. TabSheet automatically disables the tab content component when a tab becomes inactive, and enables the content component when a tab becomes active again. For a more realistic use-case you would wrap your components into a layout component, in which case the disabled state of nested components would not be changed.

This auto-disabling behavior is currently not documented in the API docs, so that could be improved.

@yuriy-fix yuriy-fix added documentation Improvements or additions to documentation vaadin-tabsheet labels May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation vaadin-tabsheet
Projects
None yet
Development

No branches or pull requests

3 participants