Skip to content

Commit

Permalink
Fixed primefaces#16847- MultiSelect | Set the default value of autoOp…
Browse files Browse the repository at this point in the history
…tionFocus to false
  • Loading branch information
mehmetcetin01140 committed Nov 26, 2024
1 parent 21a0329 commit 61281c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/primeng/src/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ export class MultiSelect extends BaseComponent implements OnInit, AfterViewInit,
* Whether to focus on the first visible or selected element when the overlay panel is shown.
* @group Props
*/
@Input({ transform: booleanAttribute }) autoOptionFocus: boolean = true;
@Input({ transform: booleanAttribute }) autoOptionFocus: boolean = false;
/**
* Callback to invoke when value changes.
* @param {MultiSelectChangeEvent} event - Custom change event.
Expand Down Expand Up @@ -2049,7 +2049,8 @@ export class MultiSelect extends BaseComponent implements OnInit, AfterViewInit,
*/
public show(isFocus?) {
this.overlayVisible = true;
const focusedOptionIndex = this.focusedOptionIndex() !== -1 ? this.focusedOptionIndex() : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1;

const focusedOptionIndex = this.focusedOptionIndex() !== -1 ? this.focusedOptionIndex() : this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : this.findSelectedOptionIndex();
this.focusedOptionIndex.set(focusedOptionIndex);

if (isFocus) {
Expand Down

0 comments on commit 61281c2

Please sign in to comment.