select2 scroll to top (and back)

Using phpm2025.1, latest template.Steps to reproduce

  • project: demo2025, table: models, field: Trademark
  • Field setup → Edit tag → Requires search enabled
  • regenerate and go to modelsadd

Add spaces (to simulate long form)

// Page Data Rendering event
public function pageDataRendering(string &$header): void
{
  // Example:
  //$header = "your header";
  $header = '
    <div>empty</div>
    <div>empty</div>
    <div>empty</div>
    <div>empty</div>
    ...(keep doubling this element until browser's vertical scrollbar shown up)....
  ';
}

Unexpected behavior

  • click on Trademark: page scroll to top
  • click anywhere on the page: page scroll back to Trademark

Same behavior on table orders2

  • field: EmployeeID → Requires search enabled
  • without Infinite Scrolling Table extension
  • regenerate and go to orders2list
  • change page size selector to bigger size (until browser’s vertical scrollbar shown up)
  • do Inline Edit on records at the bottom
  • click on EmployeeID