Skip to content

Commit

Permalink
bug: allow inputs to use autofocus property (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Jul 24, 2022
1 parent 3d33648 commit 32106d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/HTMLElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,10 @@ protected function __prop_get_autofocus():bool {

/** @link https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/autofocus */
protected function __prop_set_autofocus(bool $value):void {
$this->allowTypes(ElementType::HTMLButtonElement);
$this->allowTypes(
ElementType::HTMLButtonElement,
ElementType::HTMLInputElement,
);
if($value) {
$this->setAttribute("autofocus", "");
}
Expand Down

0 comments on commit 32106d0

Please sign in to comment.