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

layer clickaway option for render-to-layer/popover #2359

Merged
merged 1 commit into from
Dec 3, 2015

Conversation

chrismcv
Copy link
Contributor

@chrismcv chrismcv commented Dec 3, 2015

@oliviertassinari - ended up changing the property name to useLayerForClickAway

@oliviertassinari
Copy link
Member

How can I test this?

@chrismcv
Copy link
Contributor Author

chrismcv commented Dec 3, 2015

So on icon menu/menu - you can still click underlying elements, because they pass in false to the new prop.

On Popover, it doesn't, so if you click on the left nav, it will now close the popover rather than trigger a navigation.

this._layer.style.bottom = 0;
this._layer.style.left = 0;
this._layer.style.right = 0;
this._layer.style.zIndex = 20;
Copy link
Member

Choose a reason for hiding this comment

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

20 seems to be a magic number

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it matches zIndex of Popover L#124 - what do you want to do with it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

zIndex of 0 works, so now using this

@oliviertassinari
Copy link
Member

What should we do for https://github.com/callemall/material-ui/blob/master/src/dialog.jsx#L458?
Maybe adding useLayerForClickAway={false}?

@oliviertassinari
Copy link
Member

@chrismcv I like this new property 👍.

@oliviertassinari oliviertassinari added the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Dec 3, 2015
@chrismcv
Copy link
Contributor Author

chrismcv commented Dec 3, 2015

@oliviertassinari - this should be good now?

@oliviertassinari
Copy link
Member

What should we do with the Dialog component? We have kind of a duplicated logic for the clickAway.

@chrismcv
Copy link
Contributor Author

chrismcv commented Dec 3, 2015

Because it uses Overlay, I think this should probably remain as is - as the Overlay is on top of the _layer, so will have click precedence.

@chrismcv
Copy link
Contributor Author

chrismcv commented Dec 3, 2015

@oliviertassinari new commit with zIndex on theme

@@ -118,7 +132,7 @@ const Popover = React.createClass({
position: 'fixed',
top: anchor.top,
left: anchor.left,
zIndex: 20,
zIndex: 0,
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we use layerZIndex?

@chrismcv
Copy link
Contributor Author

chrismcv commented Dec 3, 2015

@oliviertassinari - this looks good now

@oliviertassinari
Copy link
Member

@chrismcv Looks good 👍. Could you squash down? I will merge 😄.

@chrismcv chrismcv force-pushed the render-to-layer-enhance branch from 976ce86 to 1141870 Compare December 3, 2015 22:38
@chrismcv
Copy link
Contributor Author

chrismcv commented Dec 3, 2015

@oliviertassinari 👍

@oliviertassinari oliviertassinari added Review: accepted and removed PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Dec 3, 2015
oliviertassinari added a commit that referenced this pull request Dec 3, 2015
layer clickaway option for render-to-layer/popover
@oliviertassinari oliviertassinari merged commit a2f378e into mui:master Dec 3, 2015
@oliviertassinari
Copy link
Member

Thanks

@chrismcv
Copy link
Contributor Author

chrismcv commented Dec 3, 2015

and you @oliviertassinari

@niba
Copy link

niba commented Dec 29, 2015

@oliviertassinari @chrismcv
There are two errors in code.

  1. Documentation says that default: false which is incorrect. The default is true.
  2. You dont pass useLayerForClickAway from popup to render layer.

@oliviertassinari
Copy link
Member

You are right on both points.
Can you open an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ClickAwayListener The React component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants