Skip to content

Commit

Permalink
Fix primefaces#1879: Input focus() should not scroll unless autoFocus…
Browse files Browse the repository at this point in the history
…=true
  • Loading branch information
melloware committed Apr 22, 2022
1 parent c2bb17f commit 649e958
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/lib/utils/DomHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,10 @@ export default class DomHandler {
* Focus an input element.
*
* @param {MutableRefObject} inputRef the input reference
* @param {boolean} autoFocus flag to control whether to scroll to the element, false by default
* @param {boolean} scrollTo flag to control whether to scroll to the element, false by default
*/
static focus(inputRef, autoFocus) {
const preventScroll = ObjectUtils.isEmpty(autoFocus) ? true : !autoFocus;
static focus(inputRef, scrollTo) {
const preventScroll = ObjectUtils.isEmpty(scrollTo) ? true : !scrollTo;
inputRef && inputRef.current && inputRef.current.focus({ preventScroll: preventScroll });
}

Expand Down

0 comments on commit 649e958

Please sign in to comment.