Skip to content

Header scrolls horizontally but body doesn't follow with header scroll #2143

Open
@mmfKupl

Description

@mmfKupl

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

The entire header row scrolls horizontally, but the body scroll does not change.

Expected behavior

The entire header row and body should scroll horizontally together.

Reproduction of the problem

  1. Create a table.
  2. Add a custom header template with an input component.
  3. Set scrollbarH to true.
  4. Make the table scrollable horizontally.
  5. Focus on the first input in the header.
  6. Press the "TAB" key to change the focus to the next input.

See example in stackblitz editor or app

I have examined the source code of ngx-datatable and found that there is no header-to-body scrolling synchronization, only body-to-header scrolling. I attempted to listen to the header scroll event and recalculate the table dimensions but was not successful.

What is the motivation / use case for changing the behavior?

The motivation for changing the behavior is to allow for the addition of inputs and other elements to the header for expanding table functionality.

Please tell us about your environment:

  • Table version: 20.1.0
  • Angular version: 15.1.0
  • Browser: [all]
  • Language: [TypeScript 4.7]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions