Skip to content

Commit 52d0320

Browse files
author
Konstantin Marushchak
committed
chore(modal): remove redundant comments
1 parent 7095130 commit 52d0320

2 files changed

Lines changed: 2 additions & 33 deletions

File tree

‎src/components/Modal.tsx‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ export type Props = {
5353
* Element to focus when the modal closes.
5454
*/
5555
restoreFocusRef?: React.RefObject<View | null>;
56-
// TODO_REMOVE: both the prop and its default belong to #5125.
5756
/**
58-
* Accessibility label of the modal's content.
57+
* Accessible name for the modal.
5958
*/
6059
'aria-label'?: string;
6160
/**
@@ -143,8 +142,7 @@ function Modal({
143142
visible = false,
144143
initialFocusRef,
145144
restoreFocusRef,
146-
// TODO_REMOVE: both the prop and its default belong to #5125.
147-
'aria-label': ariaLabel = 'Dialog',
145+
'aria-label': ariaLabel,
148146
overlayAccessibilityLabel = 'Close modal',
149147
overlayTestID,
150148
onDismiss = () => {},
@@ -278,10 +276,6 @@ function Modal({
278276
>
279277
<Surface
280278
ref={contentRef}
281-
/* TODO_REMOVE: #5125 owns the modal's role and name, and moves
282-
`aria-modal` off the wrapper above onto this surface. Until it
283-
lands, moving focus here announces nothing, which leaves this
284-
impossible to verify with VoiceOver and TalkBack. */
285279
role="dialog"
286280
aria-modal
287281
aria-label={ariaLabel}

‎src/components/__tests__/__snapshots__/Modal.test.tsx.snap‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ exports[`Modal by default should receive appropriate top and bottom insets 1`] =
110110
}
111111
>
112112
<View
113-
aria-label="Dialog"
114113
aria-modal={true}
115114
collapsable={false}
116115
role="dialog"
@@ -321,7 +320,6 @@ exports[`Modal when open as non-dismissible modal if closed via Android back but
321320
}
322321
>
323322
<View
324-
aria-label="Dialog"
325323
aria-modal={true}
326324
collapsable={false}
327325
role="dialog"
@@ -532,7 +530,6 @@ exports[`Modal when open as non-dismissible modal if closed via Android back but
532530
}
533531
>
534532
<View
535-
aria-label="Dialog"
536533
aria-modal={true}
537534
collapsable={false}
538535
role="dialog"
@@ -743,7 +740,6 @@ exports[`Modal when open as non-dismissible modal if closed via Android back but
743740
}
744741
>
745742
<View
746-
aria-label="Dialog"
747743
aria-modal={true}
748744
collapsable={false}
749745
role="dialog"
@@ -954,7 +950,6 @@ exports[`Modal when open as non-dismissible modal if closed via touching backdro
954950
}
955951
>
956952
<View
957-
aria-label="Dialog"
958953
aria-modal={true}
959954
collapsable={false}
960955
role="dialog"
@@ -1165,7 +1160,6 @@ exports[`Modal when open as non-dismissible modal if closed via touching backdro
11651160
}
11661161
>
11671162
<View
1168-
aria-label="Dialog"
11691163
aria-modal={true}
11701164
collapsable={false}
11711165
role="dialog"
@@ -1376,7 +1370,6 @@ exports[`Modal when open as non-dismissible modal if closed via touching backdro
13761370
}
13771371
>
13781372
<View
1379-
aria-label="Dialog"
13801373
aria-modal={true}
13811374
collapsable={false}
13821375
role="dialog"
@@ -1587,7 +1580,6 @@ exports[`Modal when open if backdrop touched should invoke the onDismiss functio
15871580
}
15881581
>
15891582
<View
1590-
aria-label="Dialog"
15911583
aria-modal={true}
15921584
collapsable={false}
15931585
role="dialog"
@@ -1798,7 +1790,6 @@ exports[`Modal when open if backdrop touched should invoke the onDismiss functio
17981790
}
17991791
>
18001792
<View
1801-
aria-label="Dialog"
18021793
aria-modal={true}
18031794
collapsable={false}
18041795
role="dialog"
@@ -2009,7 +2000,6 @@ exports[`Modal when open if closed via Android back button invokes onDismiss 1`]
20092000
}
20102001
>
20112002
<View
2012-
aria-label="Dialog"
20132003
aria-modal={true}
20142004
collapsable={false}
20152005
role="dialog"
@@ -2220,7 +2210,6 @@ exports[`Modal when open if closed via Android back button invokes onDismiss 2`]
22202210
}
22212211
>
22222212
<View
2223-
aria-label="Dialog"
22242213
aria-modal={true}
22252214
collapsable={false}
22262215
role="dialog"
@@ -2431,7 +2420,6 @@ exports[`Modal when open if closed via Android back button invokes onDismiss 3`]
24312420
}
24322421
>
24332422
<View
2434-
aria-label="Dialog"
24352423
aria-modal={true}
24362424
collapsable={false}
24372425
role="dialog"
@@ -2642,7 +2630,6 @@ exports[`Modal when open runs the closing animation if visible toggled 1`] = `
26422630
}
26432631
>
26442632
<View
2645-
aria-label="Dialog"
26462633
aria-modal={true}
26472634
collapsable={false}
26482635
role="dialog"
@@ -2852,7 +2839,6 @@ exports[`Modal when open runs the closing animation if visible toggled 2`] = `
28522839
}
28532840
>
28542841
<View
2855-
aria-label="Dialog"
28562842
aria-modal={true}
28572843
collapsable={false}
28582844
role="dialog"
@@ -3062,7 +3048,6 @@ exports[`Modal when open runs the closing animation if visible toggled 3`] = `
30623048
}
30633049
>
30643050
<View
3065-
aria-label="Dialog"
30663051
aria-modal={true}
30673052
collapsable={false}
30683053
role="dialog"
@@ -3273,7 +3258,6 @@ exports[`Modal when visible prop changes again during the open/close animation w
32733258
}
32743259
>
32753260
<View
3276-
aria-label="Dialog"
32773261
aria-modal={true}
32783262
collapsable={false}
32793263
role="dialog"
@@ -3483,7 +3467,6 @@ exports[`Modal when visible prop changes again during the open/close animation w
34833467
}
34843468
>
34853469
<View
3486-
aria-label="Dialog"
34873470
aria-modal={true}
34883471
collapsable={false}
34893472
role="dialog"
@@ -3694,7 +3677,6 @@ exports[`Modal when visible prop changes again during the open/close animation w
36943677
}
36953678
>
36963679
<View
3697-
aria-label="Dialog"
36983680
aria-modal={true}
36993681
collapsable={false}
37003682
role="dialog"
@@ -3905,7 +3887,6 @@ exports[`Modal when visible prop changes again during the open/close animation w
39053887
}
39063888
>
39073889
<View
3908-
aria-label="Dialog"
39093890
aria-modal={true}
39103891
collapsable={false}
39113892
role="dialog"
@@ -4116,7 +4097,6 @@ exports[`Modal when visible prop changes from false to true (closed to open) sho
41164097
}
41174098
>
41184099
<View
4119-
aria-label="Dialog"
41204100
aria-modal={true}
41214101
collapsable={false}
41224102
role="dialog"
@@ -4327,7 +4307,6 @@ exports[`Modal when visible prop changes from false to true (closed to open) sho
43274307
}
43284308
>
43294309
<View
4330-
aria-label="Dialog"
43314310
aria-modal={true}
43324311
collapsable={false}
43334312
role="dialog"
@@ -4538,7 +4517,6 @@ exports[`Modal when visible prop changes from true to false (open to closed) sho
45384517
}
45394518
>
45404519
<View
4541-
aria-label="Dialog"
45424520
aria-modal={true}
45434521
collapsable={false}
45444522
role="dialog"
@@ -4748,7 +4726,6 @@ exports[`Modal when visible prop changes from true to false (open to closed) sho
47484726
}
47494727
>
47504728
<View
4751-
aria-label="Dialog"
47524729
aria-modal={true}
47534730
collapsable={false}
47544731
role="dialog"
@@ -4959,7 +4936,6 @@ exports[`Modal when visible prop changes from true to false (open to closed) sho
49594936
}
49604937
>
49614938
<View
4962-
aria-label="Dialog"
49634939
aria-modal={true}
49644940
collapsable={false}
49654941
role="dialog"
@@ -5169,7 +5145,6 @@ exports[`Modal when visible prop changes from true to false (open to closed) sho
51695145
}
51705146
>
51715147
<View
5172-
aria-label="Dialog"
51735148
aria-modal={true}
51745149
collapsable={false}
51755150
role="dialog"

0 commit comments

Comments
 (0)