You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a tab is added to the TabSheet and if it's the first tab, the tab sheet may automatically select this tab. This triggers the SelectedChangeEvent, but it happens before the tab component is added to the internal tabToContent map. If we want to access the selected component when the tab selection listener is notified, the tab sheet returns null.
Expected behavior
The SelectedChangeEvent should be fired after the tab component is internally registered, so that we can access is when the listener is notified.
Minimal reproducible example
var tabsheet = new TabSheet();
tabsheet.addSelectedTabChangeListener(e -> {
if (e.getSelectedTab() != null) {
Objects.requireNonNull(tabsheet.getComponent(e.getSelectedTab()));
}
});
tabsheet.addTab("tab", new Div());
Versions
Vaadin / Flow version: 24.5.0 (but may occur also on earlier versions)
The text was updated successfully, but these errors were encountered:
Description of the bug
When a tab is added to the TabSheet and if it's the first tab, the tab sheet may automatically select this tab. This triggers the SelectedChangeEvent, but it happens before the tab component is added to the internal tabToContent map. If we want to access the selected component when the tab selection listener is notified, the tab sheet returns null.
Expected behavior
The SelectedChangeEvent should be fired after the tab component is internally registered, so that we can access is when the listener is notified.
Minimal reproducible example
Versions
The text was updated successfully, but these errors were encountered: