Skip to content
New issue

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

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

Already on GitHub? # to your account

[Popover] Forward refs #14737

Merged
merged 3 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions packages/material-ui/src/Popover/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import EventListener from 'react-event-listener';
import ownerDocument from '../utils/ownerDocument';
import ownerWindow from '../utils/ownerWindow';
import { createChainedFunction } from '../utils/helpers';
import withForwardedRef from '../utils/withForwardedRef';
import withStyles from '../styles/withStyles';
import Modal from '../Modal';
import Grow from '../Grow';
Expand Down Expand Up @@ -285,6 +286,7 @@ class Popover extends React.Component {
container: containerProp,
elevation,
getContentAnchorEl,
innerRef,
marginThreshold,
ModalClasses,
onEnter,
Expand All @@ -295,7 +297,6 @@ class Popover extends React.Component {
onExiting,
open,
PaperProps,
role,
transformOrigin,
TransitionComponent,
transitionDuration: transitionDurationProp,
Expand All @@ -320,6 +321,7 @@ class Popover extends React.Component {
classes={ModalClasses}
container={container}
open={open}
ref={innerRef}
BackdropProps={{ invisible: true }}
{...other}
>
Expand All @@ -331,7 +333,6 @@ class Popover extends React.Component {
onExit={onExit}
onExited={onExited}
onExiting={onExiting}
role={role}
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 sure why we would want the role on the TransitionComponent. There was no test for it nor internal usage. Change that added this is missing.

Copy link
Member

Choose a reason for hiding this comment

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

This logic hasn't changed since the first commit. I'm happy to remove it 👍

timeout={transitionDuration}
{...TransitionProps}
onEntering={createChainedFunction(this.handleEntering, TransitionProps.onEntering)}
Expand Down Expand Up @@ -482,10 +483,6 @@ Popover.propTypes = {
* Properties applied to the [`Paper`](/api/paper/) element.
*/
PaperProps: PropTypes.object,
/**
* @ignore
*/
role: PropTypes.string,
/**
* This is the point on the popover which
* will attach to the anchor's origin.
Expand Down Expand Up @@ -536,4 +533,4 @@ Popover.defaultProps = {
transitionDuration: 'auto',
};

export default withStyles(styles, { name: 'MuiPopover' })(Popover);
export default withStyles(styles, { name: 'MuiPopover' })(withForwardedRef(Popover));
Loading