fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

WithViewport decorator hides DetailsList properties

Open sharpoverride opened this issue 9 years ago • 1 comments

Bug Report

WithViewport decorator hides DetailsList properties

  • Package version(s): 1.3.7
  • Browser and OS versions: All

Describe the issue:

Using the import declaration import { DetailsList } from 'office-ui-fabric-react' I expect to be given an instance of the component. Instead I receive a WithViewportComponent instance.

Actual behavior:

DetailsList declares that I have access to the header through instance.refs.header.root. WithViewportComponent does not contain a definition for the header ref, so I'm left with an API that completes properly in typescript, but has no way of executing at runtime

Expected behavior:

I expect to be able to use the component I've imported with all it's fields, not just the methods. There should be some method to get to the header directly.

Why this issue?

I need to show the header always on top after the user scrolls. There is no direct way that I can see to handle that case with the way the component is configured.

sharpoverride avatar Feb 01 '17 07:02 sharpoverride

Hmmm no, refs.header is not techincally part of the contract; we may remove or replace the internals at any time which would break you. You should not be digging into the internal private members of the component. While React typically expects "refs" to be public, it is not part of the IDetailsList interface which is where we'd include component contractual method definitions.

Resolving as by design, let's figure out in the other bug a way to support fixed headers better.

dzearing avatar Feb 01 '17 17:02 dzearing