Skip to content

Commit

Permalink
tweak: allow select disabled property (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b authored Oct 19, 2023
1 parent 9b586c5 commit e8af9e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/HTMLElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,7 @@ protected function __prop_set_autofocus(bool $value):void {
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement/disabled
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement/disabled
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/disabled
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElemnet/disabled
*/
protected function __prop_get_disabled():bool {
$this->allowTypes(
Expand All @@ -1903,6 +1904,7 @@ protected function __prop_get_disabled():bool {
ElementType::HTMLOptionElement,
ElementType::HTMLStyleElement,
ElementType::HTMLInputElement,
ElementType::HTMLSelectElement,
);
return $this->hasAttribute("disabled");
}
Expand All @@ -1915,6 +1917,7 @@ protected function __prop_get_disabled():bool {
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement/disabled
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLStyleElement/disabled
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElemnet/disabled
* @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElemnet/disabled
*/
protected function __prop_set_disabled(bool $value):void {
$this->allowTypes(
Expand All @@ -1925,6 +1928,7 @@ protected function __prop_set_disabled(bool $value):void {
ElementType::HTMLOptionElement,
ElementType::HTMLStyleElement,
ElementType::HTMLInputElement,
ElementType::HTMLSelectElement,
);
if($value) {
$this->setAttribute("disabled", "");
Expand Down

0 comments on commit e8af9e5

Please sign in to comment.