Skip to content

Commit ba3a97a

Browse files
author
Bianca Marina Stana
committed
Fixed popup accessibility
1 parent cd8ad8c commit ba3a97a

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

Assets/Scripts/Screen Reader/UITk/VisualTreeAccessibilityUpdater.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ void UpdateAccessibilityHierarchyRecursively(VisualElement element,
644644
shouldBeIgnored |= accElement.isIgnored;
645645
modal = accElement.isModal;
646646

647-
// If the branch is visible but the AccessibleElement does not have a node yet then create it.
648-
if (!shouldBeIgnored)
647+
// If the branch is visible but the AccessibleElement does not have a node yet, then create it.
648+
if (!shouldBeIgnored && !modal)
649649
{
650650
if (!IsNodeValid(accElement.node))
651651
{

Assets/Scripts/UITk/Controls/Popup.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,8 @@ public PopupContent()
7575

7676
PopupOverlay m_Overlay;
7777

78-
ClosePolicy m_ClosePolicy = ClosePolicy.CloseOnPressOutside | ClosePolicy.CloseOnEscape;
79-
8078
[UxmlAttribute, CreateProperty]
81-
public ClosePolicy closePolicy
82-
{
83-
get => m_ClosePolicy;
84-
set => m_ClosePolicy = value;
85-
}
79+
public ClosePolicy closePolicy { get; set; } = ClosePolicy.CloseOnPressOutside | ClosePolicy.CloseOnEscape;
8680

8781
public Popup()
8882
{

Assets/Scripts/UITk/MainView.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ void MoveCard(bool shouldMoveLeft, int count = 1)
740740
// two cards.
741741
m_MainView.schedule.Execute(() =>
742742
AssistiveSupport.notificationDispatcher.SendLayoutChanged(node)
743-
).ExecuteLater(50);
743+
).ExecuteLater(100);
744744

745745
if (moved)
746746
{
@@ -751,7 +751,7 @@ void MoveCard(bool shouldMoveLeft, int count = 1)
751751
// processed first so that the announcement is not interrupted by the focus change.
752752
m_MainView.schedule.Execute(() =>
753753
AssistiveSupport.notificationDispatcher.SendAnnouncement(message)
754-
).ExecuteLater(100);
754+
).ExecuteLater(200);
755755
}
756756

757757
/*var accElement = draggable.transform.GetComponent<AccessibleElement>();
@@ -817,6 +817,8 @@ void ShowGameView(Gameplay.DifficultyLevel level)
817817
void ShowExitGamePopup()
818818
{
819819
m_ExitGamePopup.Show();
820+
821+
AccessibilityManager.GetService<UITkAccessibilityService>()?.RebuildHierarchy();
820822
}
821823

822824
void CloseExitGamePopup()

0 commit comments

Comments
 (0)