[IconMenu] Set container as anchorEl when using prop 'open'#3666
[IconMenu] Set container as anchorEl when using prop 'open'#3666oliviertassinari merged 2 commits intomui:masterfrom
Conversation
| if (nextProps.open !== null) { | ||
| this.setState({ | ||
| open: nextProps.open, | ||
| anchorEl: ReactDOM.findDOMNode(this.refs.iconMenuContainer), |
There was a problem hiding this comment.
findDOMNode is not needed as the target is a dom element. Ideally, it would be even better if you could use callback refs.
There was a problem hiding this comment.
Thanks @alitaheri!, I removed findDOMNode.
|
Thanks for finding this bug 👍 👍 |
c12e754 to
796009c
Compare
|
Thanks a lot 👍 @callemall/material-ui Looking good 😁 |
|
Looks good here too, but I notice that the 'Controlled examples' aren't truly controlled - only the selected value(s) for which there's no internal state anyway. @alitaheri - would it make sense to update the controlled examples so the |
|
@mbrookes Hmmm, I guess that's why we didn't notice this bug in the first place O.o Good catch 👍 @crashbell Would that be ok to add an example for this to prevent future regressions? that would be appreciated, thanks a lot 👍 👍 :grin |
|
Let me try to update the docs. Thanks for reviewing this PR. |
|
While making the sample I found out that this issue was handled in this code but I don't know why Uncaught TypeError: Cannot read property 'getBoundingClientRect' of nullIt's working properly with the docs code. |
|
I found out the root cause here: #3647 |
|
@crashbell Thanks for getting to the bottom of it 👍 We'll release another alpha soon 😁 |
796009c to
9f901cd
Compare
9f901cd to
3c77dba
Compare
|
This is looking really good, thanks a lot for tackling this 👍 @callemall/material-ui Take a look. |
[IconMenu] Set container as anchorEl when using prop 'open'
|
@crashbell Thanks! |
|
Thanks guys for reviewing this! By the way, can you please let me know when |
|
@crashbell Probably this week, have a look at #3700. |
|
@crashbell In any case you don't need to monkey patch - just use HEAD@3c77dba97. 👍 |
|
thanks @oliviertassinari and @mbrookes so much! |



IconMenu allows to use prop
opento open the popover but theanchorElisn't set at the first load so this causes a wrong position.