Skip to content

Commit

Permalink
Merge pull request #16065 from primefaces/issue-16064
Browse files Browse the repository at this point in the history
Fixed #16064 - Button | Add focus() method
  • Loading branch information
cetincakiroglu authored Jul 25, 2024
2 parents 743e36b + 5a09d5b commit 525b383
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/components/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,14 @@ export class Button implements AfterContentInit {
'p-badge-no-gutter': this.badge && String(this.badge).length === 1
};
}

/**
* Applies focus.
* @group Method
*/
public focus() {
this.el.nativeElement.firstChild.focus();
}
}

@NgModule({
Expand Down

0 comments on commit 525b383

Please sign in to comment.