microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.53k stars 2.73k forks source link

DropDown's responsiveMode prop enum type should exposed from 'office-ui-fabric-react' #9013

Closed LiangMingChen closed 5 years ago

LiangMingChen commented 5 years ago

Environment Information

Please provide a reproduction of the bug in a codepen:

<Dropdown label={this.props.label} options={this.resolveOptions()} placeholder={this.props.placeholder} onRenderList={this.renderCalloutList} onRenderOption={this.props.customListElementRender} selectedKeys={this.props.selectedItems as string[]} multiSelect={this.props.multiSelect} onChange={this.props.onChange} disabled={this.props.isDisabled} styles={this.props.styles} errorMessage={this.props.errorMessage} onDismiss={this.onDropdownDismissed} calloutProps={calloutProps} responsiveMode={ResponsiveMode.large} />

Actual behavior:

ResponsiveMode is only available through directly linkinig into lib

https://github.com/OfficeDev/office-ui-fabric-react/blob/acefdefb12eec6c495d5ffe25625b7da9d17cf78/packages/example-app-base/src/components/App/App.tsx#L7

This specifically crash create-react-app https://github.com/facebook/create-react-app

Jest test enviroment which compiled by node (thus need commonjs module)

if we include reference for the enum type for the number from lib-commonjs folder, we end packing both office-ui-fabrid-react/lib and office-ui-fabric-react/lib-commonjs

Expected behavior:

Since a component is using by a component (in this case DropDown) The prop type should be available from the same level, ie 'office-ui-fabric-react'

import { ResponsiveMode } from 'office-ui-fabric-react'

Priorities and help requested:

Are you willing to submit a PR to fix? (Yes, No)

Requested priority: (Blocking, High, Normal, Low)

Products/sites affected: (if applicable)

jdhuntington commented 5 years ago

Thanks @LiangMingChen -- have created #9018 to fix.

msft-github-bot commented 5 years ago

:tada:This issue was addressed in #9018, which has now been successfully released as office-ui-fabric-react@v6.180.0.:tada:

Handy links: