This repository was archived by the owner on Mar 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 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
100100 {
101101 return ['aria-dropeffect ' ];
102102 }
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+
103114 static public function flowto (): array
104115 {
105116 return ['aria-flowto ' ];
Original file line number Diff line number Diff line change 77
88use Eightfold \Markup \Html \Data \Elements ;
99use Eightfold \Markup \Html \Data \AriaRoles ;
10+ use Eightfold \Markup \Html \Data \Attributes \Aria ;
1011
1112use Eightfold \Markup \Html \Data \Attributes \Content ;
1213
@@ -83,4 +84,13 @@ static public function optionalAriaRoles(): array
8384 AriaRoles::radio ()
8485 );
8586 }
87+
88+ static public function optionalAriaAttributes (): array
89+ {
90+ return array_merge (
91+ parent ::optionalAriaAttributes (),
92+ Aria::expanded (),
93+ Aria::pressed ()
94+ );
95+ }
8696}
Original file line number Diff line number Diff line change @@ -93,4 +93,11 @@ public function testCanHaveAriaHidden()
9393 $ actual = Html::div ()->attr ("aria-hidden true " );
9494 $ this ->assertSame ($ expected , $ actual ->unfold ());
9595 }
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+ }
96103}
You can’t perform that action at this time.
0 commit comments