This repository was archived by the owner on Mar 5, 2023. It is now read-only.
File tree 3 files changed +28
-0
lines changed
3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,17 @@ static public function dropeffect(): array
100
100
{
101
101
return ['aria-dropeffect ' ];
102
102
}
103
+
104
+ static public function expanded (): array
105
+ {
106
+ return ['aria-expanded ' ];
107
+ }
108
+
109
+ static public function pressed (): array
110
+ {
111
+ return ['aria-pressed ' ];
112
+ }
113
+
103
114
static public function flowto (): array
104
115
{
105
116
return ['aria-flowto ' ];
Original file line number Diff line number Diff line change 7
7
8
8
use Eightfold \Markup \Html \Data \Elements ;
9
9
use Eightfold \Markup \Html \Data \AriaRoles ;
10
+ use Eightfold \Markup \Html \Data \Attributes \Aria ;
10
11
11
12
use Eightfold \Markup \Html \Data \Attributes \Content ;
12
13
@@ -83,4 +84,13 @@ static public function optionalAriaRoles(): array
83
84
AriaRoles::radio ()
84
85
);
85
86
}
87
+
88
+ static public function optionalAriaAttributes (): array
89
+ {
90
+ return array_merge (
91
+ parent ::optionalAriaAttributes (),
92
+ Aria::expanded (),
93
+ Aria::pressed ()
94
+ );
95
+ }
86
96
}
Original file line number Diff line number Diff line change @@ -93,4 +93,11 @@ public function testCanHaveAriaHidden()
93
93
$ actual = Html::div ()->attr ("aria-hidden true " );
94
94
$ this ->assertSame ($ expected , $ actual ->unfold ());
95
95
}
96
+
97
+ public function testCanHaveAriaExpanded ()
98
+ {
99
+ $ expected = '<button aria-expanded="false"></button> ' ;
100
+ $ actual = Html::button ()->attr ("aria-expanded false " );
101
+ $ this ->assertEquals ($ expected , $ actual ->unfold ());
102
+ }
96
103
}
You can’t perform that action at this time.
0 commit comments