diff --git a/vaadin-button-flow-parent/vaadin-button-flow/src/main/java/com/vaadin/flow/component/button/Button.java b/vaadin-button-flow-parent/vaadin-button-flow/src/main/java/com/vaadin/flow/component/button/Button.java index 4cf70234056..ee9c26f9375 100644 --- a/vaadin-button-flow-parent/vaadin-button-flow/src/main/java/com/vaadin/flow/component/button/Button.java +++ b/vaadin-button-flow-parent/vaadin-button-flow/src/main/java/com/vaadin/flow/component/button/Button.java @@ -15,8 +15,6 @@ */ package com.vaadin.flow.component.button; -import com.vaadin.experimental.Feature; -import com.vaadin.experimental.FeatureFlags; import com.vaadin.flow.component.ClickEvent; import com.vaadin.flow.component.ClickNotifier; import com.vaadin.flow.component.Component; @@ -33,7 +31,6 @@ import com.vaadin.flow.component.SignalPropertySupport; import com.vaadin.flow.component.Tag; import com.vaadin.flow.component.Text; -import com.vaadin.flow.component.UI; import com.vaadin.flow.component.dependency.JsModule; import com.vaadin.flow.component.dependency.NpmPackage; import com.vaadin.flow.component.html.Image; @@ -452,24 +449,11 @@ public boolean isDisableOnClick() { /** * Sets the button explicitly disabled or enabled. When disabled, the button - * is rendered as "dimmed". - *

- * By default, disabled buttons are not focusable and don't react to hover. - * As a result, they are hidden from assistive technologies, and it's not - * possible to show a tooltip to explain why they are disabled. This can be - * addressed by enabling the feature flag {@code accessibleDisabledButtons}, - * which makes disabled buttons focusable and hoverable, while still - * preventing them from being activated. To enable this feature flag, add - * the following line to - * {@code src/main/resources/vaadin-featureflags.properties}: - * - *

-     * com.vaadin.experimental.accessibleDisabledButtons = true
-     * 
+ * is rendered as "dimmed" and prevented from being activated. Disabled + * buttons remain focusable and hoverable, so they stay visible to assistive + * technologies and can show a tooltip to explain why they are disabled. + * Focus events and focus shortcuts also remain active for disabled buttons. * - * This feature flag will also enable focus events and focus shortcuts for - * disabled buttons. - * * @since 24.3.8 */ @Override @@ -506,17 +490,8 @@ public SignalBinding bindEnabled(Signal enabledSignal) { /** * {@inheritDoc} *

- * By default, focus shortcuts are only active when the button is enabled. - * To make disabled buttons also focusable, enable the following feature - * flag in {@code src/main/resources/vaadin-featureflags.properties}: - * - *

-     * com.vaadin.experimental.accessibleDisabledButtons = true
-     * 
+ * Focus shortcuts are also active when the button is disabled. * - * This feature flag will enable focus events and focus shortcuts for - * disabled buttons. - * * @since 24.7 */ @Override @@ -524,26 +499,15 @@ public ShortcutRegistration addFocusShortcut(Key key, KeyModifier... keyModifiers) { ShortcutRegistration registration = Focusable.super.addFocusShortcut( key, keyModifiers); - if (isFeatureFlagEnabled(FeatureFlags.ACCESSIBLE_DISABLED_BUTTONS)) { - registration.setDisabledUpdateMode(DisabledUpdateMode.ALWAYS); - } + registration.setDisabledUpdateMode(DisabledUpdateMode.ALWAYS); return registration; } /** * {@inheritDoc} *

- * By default, buttons are only focusable in the enabled state. To make - * disabled buttons also focusable, enable the following feature flag in - * {@code src/main/resources/vaadin-featureflags.properties}: + * Focus events are also fired when the button is disabled. * - *

-     * com.vaadin.experimental.accessibleDisabledButtons = true
-     * 
- * - * This feature flag will enable focus events and focus shortcuts for - * disabled buttons. - * * @since 24.7 */ @SuppressWarnings({ "unchecked", "rawtypes" }) @@ -551,26 +515,15 @@ public ShortcutRegistration addFocusShortcut(Key key, public Registration addFocusListener( ComponentEventListener> listener) { return getEventBus().addListener(FocusEvent.class, - (ComponentEventListener) listener, registration -> { - if (isFeatureFlagEnabled( - FeatureFlags.ACCESSIBLE_DISABLED_BUTTONS)) { - registration.setDisabledUpdateMode( - DisabledUpdateMode.ALWAYS); - } - }); + (ComponentEventListener) listener, registration -> registration + .setDisabledUpdateMode(DisabledUpdateMode.ALWAYS)); } /** * {@inheritDoc} *

- * By default, buttons are only focusable in the enabled state. To make - * disabled buttons also focusable, enable the following feature flag in - * {@code src/main/resources/vaadin-featureflags.properties}: + * Blur events are also fired when the button is disabled. * - *

-     * com.vaadin.experimental.accessibleDisabledButtons = true
-     * 
- * * @since 24.7 */ @SuppressWarnings({ "unchecked", "rawtypes" }) @@ -578,13 +531,8 @@ public Registration addFocusListener( public Registration addBlurListener( ComponentEventListener> listener) { return getEventBus().addListener(BlurEvent.class, - (ComponentEventListener) listener, registration -> { - if (isFeatureFlagEnabled( - FeatureFlags.ACCESSIBLE_DISABLED_BUTTONS)) { - registration.setDisabledUpdateMode( - DisabledUpdateMode.ALWAYS); - } - }); + (ComponentEventListener) listener, registration -> registration + .setDisabledUpdateMode(DisabledUpdateMode.ALWAYS)); } private void updateIconSlot() { @@ -628,24 +576,6 @@ private void updateThemeAttribute() { } } - /** - * Checks whether the given feature flag is active. - * - * @param feature - * the feature flag to check - * @return {@code true} if the feature flag is active, {@code false} - * otherwise - */ - private boolean isFeatureFlagEnabled(Feature feature) { - UI ui = UI.getCurrent(); - if (ui == null) { - return false; - } - - return FeatureFlags.get(ui.getSession().getService().getContext()) - .isEnabled(feature); - } - /** * Checks whether the component is icon-only, which is needed for automatic * assignment of icon slot name and theme attribute. diff --git a/vaadin-button-flow-parent/vaadin-button-flow/src/test/java/com/vaadin/flow/component/button/tests/AccessibleDisabledButtonTest.java b/vaadin-button-flow-parent/vaadin-button-flow/src/test/java/com/vaadin/flow/component/button/tests/AccessibleDisabledButtonTest.java index f5394917f85..344f5b48439 100644 --- a/vaadin-button-flow-parent/vaadin-button-flow/src/test/java/com/vaadin/flow/component/button/tests/AccessibleDisabledButtonTest.java +++ b/vaadin-button-flow-parent/vaadin-button-flow/src/test/java/com/vaadin/flow/component/button/tests/AccessibleDisabledButtonTest.java @@ -20,7 +20,6 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.mockito.Mockito; -import com.vaadin.experimental.FeatureFlags; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.ComponentEventListener; import com.vaadin.flow.component.ComponentUtil; @@ -31,15 +30,11 @@ import com.vaadin.flow.dom.Element; import com.vaadin.flow.internal.JacksonUtils; import com.vaadin.flow.internal.nodefeature.ElementListenerMap; -import com.vaadin.tests.EnableFeatureFlagExtension; import com.vaadin.tests.MockUIExtension; class AccessibleDisabledButtonTest { @RegisterExtension MockUIExtension ui = new MockUIExtension(); - @RegisterExtension - EnableFeatureFlagExtension featureFlagExtension = new EnableFeatureFlagExtension( - FeatureFlags.ACCESSIBLE_DISABLED_BUTTONS); private Button button = Mockito.spy(Button.class); @@ -58,20 +53,7 @@ void setUp() { @SuppressWarnings("unchecked") @Test - void accessibleButtonsDisabled_focusListenerDisabled() { - featureFlagExtension.disableFeature(); - - button.addFocusListener(mockFocusListener); - - fakeClientDomEvent(button, "focus"); - - Mockito.verify(mockFocusListener, Mockito.never()) - .onComponentEvent(Mockito.any()); - } - - @SuppressWarnings("unchecked") - @Test - void accessibleButtonsEnabled_focusListenerEnabled() { + void focusListenerActiveWhenDisabled() { button.addFocusListener(mockFocusListener); fakeClientDomEvent(button, "focus"); @@ -82,20 +64,7 @@ void accessibleButtonsEnabled_focusListenerEnabled() { @SuppressWarnings("unchecked") @Test - void accessibleButtonsDisabled_blurListenerDisabled() { - featureFlagExtension.disableFeature(); - - button.addBlurListener(mockBlurListener); - - fakeClientDomEvent(button, "blur"); - - Mockito.verify(mockBlurListener, Mockito.never()) - .onComponentEvent(Mockito.any()); - } - - @SuppressWarnings("unchecked") - @Test - void accessibleButtonsEnabled_blurListenerEnabled() { + void blurListenerActiveWhenDisabled() { button.addBlurListener(mockBlurListener); fakeClientDomEvent(button, "blur"); @@ -105,26 +74,7 @@ void accessibleButtonsEnabled_blurListenerEnabled() { } @Test - void accessibleButtonsDisabled_focusShortcutDisabled() { - featureFlagExtension.disableFeature(); - - button.addFocusShortcut(Key.KEY_A); - ui.add(button); - ui.fakeClientCommunication(); - - var keydownEvent = new KeyDownEvent(button, "A"); // actual key of the - // event doesn't - // matter with this - // test setup, as the - // filtering happens - // on the client side - ComponentUtil.fireEvent(ui.getUI(), keydownEvent); - - Mockito.verify(button, Mockito.never()).focus(); - } - - @Test - void accessibleButtonsEnabled_focusShortcutEnabled() { + void focusShortcutActiveWhenDisabled() { button.addFocusShortcut(Key.KEY_A); ui.add(button); ui.fakeClientCommunication(); diff --git a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/src/main/resources/vaadin-featureflags.properties b/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/src/main/resources/vaadin-featureflags.properties deleted file mode 100644 index c2aeeeb1d4f..00000000000 --- a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow-integration-tests/src/main/resources/vaadin-featureflags.properties +++ /dev/null @@ -1 +0,0 @@ -com.vaadin.experimental.accessibleDisabledMenuItems=true diff --git a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/AccessibleDisabledMenuItemsFeatureFlagProvider.java b/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/AccessibleDisabledMenuItemsFeatureFlagProvider.java deleted file mode 100644 index f03e768e1ce..00000000000 --- a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/AccessibleDisabledMenuItemsFeatureFlagProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2026 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.flow.component.contextmenu; - -import java.util.List; - -import com.vaadin.experimental.Feature; -import com.vaadin.experimental.FeatureFlagProvider; - -/** - * @since 25.2 - */ -public class AccessibleDisabledMenuItemsFeatureFlagProvider - implements FeatureFlagProvider { - - public static final Feature ACCESSIBLE_DISABLED_MENU_ITEMS = new Feature( - "Accessible disabled menu items", "accessibleDisabledMenuItems", - "https://vaadin.com/docs/latest/components/context-menu#disabled-menu-items", - true, null); - - @Override - public List getFeatures() { - return List.of(ACCESSIBLE_DISABLED_MENU_ITEMS); - } -} diff --git a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/MenuItem.java b/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/MenuItem.java index 1b310fb0f5a..1d44c44f17b 100644 --- a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/MenuItem.java +++ b/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/MenuItem.java @@ -47,21 +47,11 @@ protected SubMenu createSubMenu() { /** * Sets the menu item explicitly disabled or enabled. When disabled, menu - * items are rendered as "dimmed". - *

- * By default, disabled items are not focusable and don't react to hover. As - * a result, they are hidden from assistive technologies, and it's not - * possible to show a tooltip to explain why they are disabled. This can be - * addressed by enabling the feature flag - * {@code accessibleDisabledMenuItems}, which makes disabled items focusable - * and hoverable, while still preventing them from being activated. To - * enable this feature flag, add the following line to - * {@code src/main/resources/vaadin-featureflags.properties}: + * items are rendered as "dimmed" and prevented from being activated. + * Disabled items remain focusable and hoverable, so they stay visible to + * assistive technologies and can show a tooltip to explain why they are + * disabled. * - *

-     * com.vaadin.experimental.accessibleDisabledMenuItems = true
-     * 
- * * @since 25.2 */ @Override diff --git a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/resources/META-INF/services/com.vaadin.experimental.FeatureFlagProvider b/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/resources/META-INF/services/com.vaadin.experimental.FeatureFlagProvider deleted file mode 100644 index a56d2b1923e..00000000000 --- a/vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/resources/META-INF/services/com.vaadin.experimental.FeatureFlagProvider +++ /dev/null @@ -1 +0,0 @@ -com.vaadin.flow.component.contextmenu.AccessibleDisabledMenuItemsFeatureFlagProvider diff --git a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow-integration-tests/src/main/resources/vaadin-featureflags.properties b/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow-integration-tests/src/main/resources/vaadin-featureflags.properties deleted file mode 100644 index 62d1eb1a38a..00000000000 --- a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow-integration-tests/src/main/resources/vaadin-featureflags.properties +++ /dev/null @@ -1,2 +0,0 @@ -com.vaadin.experimental.accessibleDisabledButtons=true -com.vaadin.experimental.accessibleDisabledMenuItems=true diff --git a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBarItem.java b/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBarItem.java index 27966709277..d2d1cede73f 100644 --- a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBarItem.java +++ b/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBarItem.java @@ -43,23 +43,10 @@ protected MenuBarSubMenu createSubMenu() { /** * Sets the menu item explicitly disabled or enabled. When disabled, menu - * bar items are rendered as "dimmed". - *

- * By default, disabled items are not focusable and don't react to hover. As - * a result, they are hidden from assistive technologies, and it's not - * possible to show a tooltip to explain why they are disabled. This can be - * addressed by enabling several feature flags, which make disabled items - * focusable and hoverable, while still preventing them from being - * activated. To enable the feature flags, add the following lines to - * {@code src/main/resources/vaadin-featureflags.properties}: - * - *

-     * # Allow focus and hover interactions with disabled menu bar root items (buttons)
-     * com.vaadin.experimental.accessibleDisabledButtons = true
-     *
-     * # Allow focus and hover interactions with disabled menu bar sub-menu items
-     * com.vaadin.experimental.accessibleDisabledMenuItems = true
-     * 
+ * bar items are rendered as "dimmed" and prevented from being activated. + * Disabled items remain focusable and hoverable, so they stay visible to + * assistive technologies and can show a tooltip to explain why they are + * disabled. */ @Override public void setEnabled(boolean enabled) {