Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dialog] Forward refs #14775

Merged
merged 2 commits into from Mar 7, 2019
Merged

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Mar 6, 2019

Breaking change

const ref = React.createRef();
<Dialog innerRef={ref} />
- // ref.current points to Dialog instance
+ // ref.current points to Modal instance which will point to a HTMLElement in the future

Continues #14536

@eps1lon eps1lon added breaking change component: dialog This is the name of the generic UI component, not the React module! labels Mar 6, 2019
@eps1lon eps1lon added this to the v4 milestone Mar 6, 2019
@@ -227,6 +229,7 @@ class Dialog extends React.Component {
onClick={this.handleBackdropClick}
onMouseDown={this.handleMouseDown}
role="document"
data-mui-test="FakeBackdrop"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not happy with that but we need this for testing backdrop related stuff.

onEscapeKeyDown={onEscapeKeyDown}
onClose={onClose}
hideOnBackdropClick={false}
hideOnEscapeKeyUp={false}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were renamed previously. Another advantage of mount over shallow.

assert.strictEqual(paper.hasClass(classes.paper), true);
});

it('should not be open by default', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disregarding that the very next test contradicts this it should be neither by default. open is required.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

@@ -84,133 +93,118 @@ describe('<Dialog />', () => {
assert.strictEqual(wrapper.hasClass('woofDialog'), true);
});

it('should render Fade > div > Paper > children inside the Modal', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That test isn't very useful since there a many other intermediary components. This test compounds many other test anyway and can be safely removed.

@eps1lon eps1lon marked this pull request as ready for review March 6, 2019 19:42
@mui-pr-bot
Copy link

mui-pr-bot commented Mar 6, 2019

Details of bundle changes.

Comparing: b8a3336...11dd958

bundle parsed diff gzip diff prev parsed current parsed prev gzip current gzip
@material-ui/core +0.01% 🔺 -0.00% 371,832 371,865 91,939 91,936
@material-ui/core/Paper 0.00% -0.01% 76,648 76,648 19,308 19,306
@material-ui/core/Paper.esm 0.00% -0.02% 71,599 71,599 18,783 18,780
@material-ui/core/Popper 0.00% -0.02% 30,462 30,462 10,582 10,580
@material-ui/core/styles/createMuiTheme 0.00% 0.00% 17,286 17,286 5,717 5,717
@material-ui/core/useMediaQuery 0.00% 0.00% 2,486 2,486 1,049 1,049
@material-ui/lab 0.00% -0.01% 184,281 184,281 50,584 50,580
@material-ui/styles 0.00% -0.01% 55,687 55,687 15,825 15,824
@material-ui/system 0.00% +0.02% 🔺 17,062 17,062 4,482 4,483
Button 0.00% -0.00% 99,409 99,409 26,607 26,606
Modal 0.00% -0.05% 98,984 98,984 26,263 26,251
colorManipulator 0.00% 0.00% 3,232 3,232 1,296 1,296
docs.landing 0.00% 0.00% 51,891 51,891 11,291 11,291
docs.main 0.00% 0.00% 678,326 678,326 206,184 206,184
packages/material-ui/build/umd/material-ui.production.min.js 0.00% -0.00% 322,466 322,482 85,044 85,040

Generated by 🚫 dangerJS against 11dd958

@eps1lon eps1lon force-pushed the feat/Dialog/forwardRef branch 2 times, most recently from 110a8de to 1666dc7 Compare March 7, 2019 11:24
eps1lon added a commit that referenced this pull request Mar 7, 2019
Partial revert of #14643.

While the build with `-browser` images technically improved reproducability of the build it creates less deterministic builds. The selenium image even caused errors on builds with the exact same docker images sha. 

Prerequisite for #14775
@oliviertassinari oliviertassinari merged commit 81193d3 into mui:next Mar 7, 2019
@eps1lon eps1lon deleted the feat/Dialog/forwardRef branch March 7, 2019 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: dialog This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants