From 07f801143c07fbeb649401236b69544f48b8f7b4 Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 25 Nov 2025 18:33:30 +0100 Subject: [PATCH] Fix bug where a disabled ToggleButton could be toggled using screen readers --- modules/juce_gui_basics/buttons/juce_Button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/buttons/juce_Button.cpp b/modules/juce_gui_basics/buttons/juce_Button.cpp index 102e50c318..70ba77b3ee 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.cpp +++ b/modules/juce_gui_basics/buttons/juce_Button.cpp @@ -171,7 +171,7 @@ void Button::setToggleState (bool shouldBeOn, NotificationType notification) void Button::setToggleState (bool shouldBeOn, NotificationType clickNotification, NotificationType stateNotification) { - if (shouldBeOn != lastToggleState) + if (isEnabled() && shouldBeOn != lastToggleState) { WeakReference deletionWatcher (this);