[NUI] Delegate Button.OnAccessibilityActivated() to OnKey() (#2699)
authorArtur Świgoń <aswigon@yandex.com>
Fri, 5 Mar 2021 01:32:21 +0000 (02:32 +0100)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 8 Mar 2021 08:29:15 +0000 (17:29 +0900)
commit9f7bb61690a279b2e3184d06562070b54f1a4d9f
tree90668719c9b62ffa02c0f95f27e483f1042e3901
parent7645a13ba30a9d29746860bb35935e33aa02028a
[NUI] Delegate Button.OnAccessibilityActivated() to OnKey() (#2699)

This commit fixes a bug where it was possible to select multiple radio
buttons from one RadioButtonGroup in accessibility (screen reader) mode.

OnAccessibilityActivated() contained code copied from OnKey(). However,
some classes derived from Button override OnKey(), e.g. SelectButton
makes sure that other buttons in the group are unselected if necessary.
Rather than overriding OnAccessibilityActivated() in derived classes, it
is better to invoke OnKey() instead, in order to reduce code
duplication.

Note: this change matches the corresponding logic in DALi Toolkit, where
OnAccessibilityActivated() is implemented in terms of OnKeyboardEnter().

Co-authored-by: Artur Świgoń <a.swigon@samsung.com>
src/Tizen.NUI.Components/Controls/Button.Internal.cs