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

[For Review] Menu/Popover/IconMenu/Dialog Portal updates #1845

Closed
wants to merge 3 commits into from

Conversation

chrismcv
Copy link
Contributor

@chrismcv chrismcv commented Oct 8, 2015

This PR
a) currently breaks dialogs
b) introduces a component Popover which is an arbitrary control that shows a popup menu, either onClick or on props.open = true.
c) Popover component wraps menu in IconMenu - nearly transparently.
d) Popover renders to a new DOM Tree, and in theory context should transfer for [email protected]
e) Dialog renders into new tree, but has issues that I'll sort shortly...

@@ -67,7 +68,7 @@ let AppRoutes = (

<Route name="customization" handler={Customization}>
<Route name="colors" handler={Colors} />
<Route name="themes" handler={Themes} />
<Route name="themes" handler={Themes} />let
Copy link
Contributor

Choose a reason for hiding this comment

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

is it necessary?

@chrismcv
Copy link
Contributor Author

chrismcv commented Oct 9, 2015

Updated PR:

  • Dialog is fixed via a wrapper
  • I'm having a problem with warnings on the DatePickerDialog/TimePickerDialog and contexts - any suggestions welcome @hai-cea @shaurya947
  • I think there is some scope to simplify menu's now that animation/positioning is delegated to the popover component

@chrismcv chrismcv changed the title [For Review] Menu updates [For Review] Menu/Popover/IconMenu/Dialog Portal updates Oct 9, 2015
@chrismcv chrismcv force-pushed the popups branch 6 times, most recently from b7ff8ac to 201dfc1 Compare October 15, 2015 15:35
@chrismcv
Copy link
Contributor Author

I've updated this PR - lots of changes....

  • New component "Popover"
  • New mixin "Render to layer"
  • React 14 support

Updated the following components to use it

  • Dropdown menu
  • Icon Menu
  • Dialog
  • SelectField
  • Menu (menus/menu-item.jsx) when it has nested items

It'd be great if review + merge process could start?

@@ -331,7 +331,8 @@ const TextField = React.createClass({
inputProps.onChange = this._handleInputChange;
}
if (this.props.children) {
inputElement = React.cloneElement(this.props.children, {...inputProps, ...this.props.children.props});
let childInputStyle = this.mergeStyles(inputStyle, this.props.children.style);
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove the extra commit from #1896?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#1896 is that single commit... do you want it removed from #1845 (the big one?)

Copy link
Member

Choose a reason for hiding this comment

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

I think that #1896 will be reviewed and merged before this big PR.
I don't know if github will complain if we merge #1896 first.

@shaurya947
Copy link
Contributor

@chrismcv are you still having the warnings regarding context? I was hoping they would go away with React v14 as context moves from being owner-based to parent-based.

@oliviertassinari seems like you have reviewed this a little. Is it merge-ready?

@chrismcv
Copy link
Contributor Author

v14 has sorted context issues happily. I removed the initial context hacks that I had in for v13.

I think the changes here are significant, and technically, they are just about there now.

There are a few more docs changes I think we should put in. (And at least one fix to docs site "customisation section").

I've made dialog have an open property which controls visibility and depreciates show and hide. There is a manual override that allows show and hide but this is defaulted to false which means a breaking change.

The Dropdown/Icon Menu transitions are subtly different from previous.

The bit I'd like you to look at is the interface for position the popover. I've introduced anchorEl and targetEl positions. So you can say that the top left of the popover should show originating at the bottom right of the target element. (see icon menu docs for examples).

My nested menu support is a little rudimentary, its currently missing some keyboard support - but this seems partly true of the new menus stuff in general.

@shaurya947
Copy link
Contributor

@chrismcv look at #1996 regarding props for Dialog.

@oliviertassinari
Copy link
Member

@shaurya947 not yet

@chrismcv
Copy link
Contributor Author

@shaurya947 I've landed on something very similar to #1996, bar my property is called open rather than isOpen and I haven't removed the imperative API, though am happy to do that? Was that the final agreement for #1996?

@shaurya947
Copy link
Contributor

@chrismcv we're slightly short of a final agreement on that. Should reach a conclusion soon hopefully! :-)

],
},
{
name: 'Methods',
Copy link
Member

Choose a reason for hiding this comment

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

Do we need those imperative methods? I would rather avoid them.

@oliviertassinari
Copy link
Member

@chrismcv There is a lot in this PR. Can't we split this into independent bit?

@chrismcv
Copy link
Contributor Author

chrismcv commented Nov 2, 2015

@oliviertassinari - yes I agree.
Happy to split - and can do so this evening I think.

Does the following make sense (1+2 being dependencies for 3+4)

  1. Render to Layer component
  2. Popover component
  3. Dialog to use render to layer (and fix other dialogs + docs)
  4. IconMenu/NestedMenus

This was referenced Nov 2, 2015
@shaurya947
Copy link
Contributor

@chrismcv is this PR stale then? Are you going to close it?

@chrismcv
Copy link
Contributor Author

closing for now - more to follow

@chrismcv chrismcv closed this Nov 11, 2015
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Nov 10, 2020
* Change component name from MuiPickers to MuiPicker

* Name root classnames "root"

* Use pseudo-classes for disabled styling

* Remove useless yearDisabled class

* Update demo and typescript tests for overrides

* Repalce MuiPicker with MuiPickers

* Consolidate right component display name with mui component name

* Update index.ts reexports to match component display names

* Remove useless parameter

* Fix docs example

* Fix override example tsc

* Use pseudo-classes for selected and disabled, closes mui#1845

* Address PR feedback

* Update lib/src/Picker/Picker.tsx

Co-authored-by: Olivier Tassinari <[email protected]>

* Update lib/src/views/Clock/Clock.tsx

Co-authored-by: Olivier Tassinari <[email protected]>

* Make more convenient css classes names

* Remove today border from selected day

* Remove useless comment

* Update tests

* Fix global overrid of Mui-selected and Mui-disabled classes

* Use theme.palette.secondary instead of hint

* Fix linter

* Fix incorrect package prefix

Co-authored-by: Olivier Tassinari <[email protected]>
@zannager zannager added component: dialog This is the name of the generic UI component, not the React module! component: menu This is the name of the generic UI component, not the React module! component: Popover The React component. labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dialog This is the name of the generic UI component, not the React module! component: menu This is the name of the generic UI component, not the React module! component: Popover The React component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants