How can I disable the p-checkbox getting the focus to jump screen to center the checkbox?

UI Components for Angular
Post Reply
Letholdrus
Posts: 9
Joined: 23 Jun 2017, 21:05

10 Mar 2020, 12:05

Hi all

I have p-checkbox components in a table and want to disable the component getting the focus and centering the view on it when clicked.

This is in my html:

Code: Select all

<p-checkbox
    name="select-{{rowIndex}}"
    [(ngModel)]="quotationLine['selectedForDeletion']"
    binary="true" (focus)="onFocus($event)"
    (onChange)="onSelectedForDeletion(quotationLine, $event)">
</p-checkbox>
And this in my ts:

Code: Select all

onFocus($event: FocusEvent) {
        window.scrollBy(0, 0);
    }
But it does not seem to disable the checkbox receiving center.

Letholdrus
Posts: 9
Joined: 23 Jun 2017, 21:05

11 Mar 2020, 08:50

Could not get this component to not consume the focus and destroy the view so used a normal HTML5 checkbox instead and it works flawlessly when used inside a scroll able table.

EDIT: This is on primeng-lts 8.1.6 using the Avalon layout and theme.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests