-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Popover] Positioning delayed #8040
Comments
I'm seeing this exact behavior in Edit: just looked more closely at the 1.x beta code, and it doesn't seem to have a setTimeout for the placement positioning. |
I am also having this same problem. Removing the setTimeout indeed fixes the issue. Right now we are hotpatching Popover.prototype to remove the setTimeout. |
Side note, the |
Yes, I happened to have noticed this now on slower devices as well. It was a quick fix for making the pre-v1 version of material-ui compatible with React Fiber. It seems like it's showing its cracks... Basically, the API has changed when working on lower level rendering order stuff. As far as I know the next version of material-ui has rewritten this part of the rendering process to be compatible with React Fiber without such hacks - using the newer API interface. When using React v16 with the 0.19 versions of material-ui, without this |
Any update with this one? |
Indeed, any planned release date for a fix? |
This bug also happens for me with React v16, so I don't think the fix does what it intends to do in the first place. It happens consistently for me on React 15.6 and React 16 |
As mentioned earlier, there were some underlying changes that have happened with React v16 which is causing however the Popover stuff used to render, to not render at the right anchor point anymore. This Unfortunately it was not a complete solution, and I realise this problem of the flashing The whole reason I put the If you want to support React v16, although flawed, this I am told that the new v1 versions of |
Any chance we can get a fix? This introduced a bad regression. |
@lostpebble You have been doing an excellent job adding the support of react@16 with our legacy version! @bradbirnbaum Given the impact of this issue, I could try to find some time to work on it, but no promise, I have a lot of other important issues I want to take care of on the v1 branch. |
Just want to say -- This is happening in react 15 as well, so it's not currently limited to 16 either. |
Material-UI is not quite ready for react-16, see mui/material-ui#8040 This reverts commit 4970909, reversing changes made to bd2c3f8.
It also appears that there is no enter animation of the popover since the fix by @lostpebble |
Yeah, the open animation doesn't work. This definitely needs attention. |
@austinh Can you give more details about your hotpatching solution on Popover.prototype please ? since apparently this won't be fixed for M-UI < v1,x (?) |
I have since moved on from the hotpatching solution b/c I’m trying to transition to mui v1, but if you look at the Popover.js class in this library and override the functions with Popover.prototype.componentDidMount/etc and change the setTimeouts to just be function that pass through, you might get it to still work. You can also try extending Popover with class Popover2 extends Popover syntax and just use Popover2 so that you don’t have to overwrite the prototype chain.
… On Oct 26, 2017, at 6:05 AM, Raphaël Morineau ***@***.***> wrote:
@austinh Can you give more details about your hotpatching solution on Popover.prototype please ? since apparently this won't be fixed for M-UI < v1,x (?)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Got same issue: Popover blinks for some few visible frames (1000ms/24) on top-left corner of screen and then shows up in correct place without transition. Popover closes with part of transition and then dissappears. Found situtaion: if you update DOM with sth after (in my case Waiting for ETA and fix itself. Thanks! |
I am trying to dig into this issue, but I am having trouble re-creating it. The Material-UI docs site has it working, even if I upgrade it to use React 15.6.2. (Upgrading to React 16.x is very involved...trying to hold off on that unless we must do it.) Does anyone have concrete steps that made this appear? |
I have the problem using React 15.6.1 with the tap even plugin (2.0.1) and Material-UI 0.19.3. I'll see if I can have someone build a minimal test project that re-creates the problem next week. |
I see this issue with React 15.6.2, tap event plugin 2.0.1 and and Material-UI 0.19.4 |
There is reproducing https://github.com/leanmarine/material-ui-debug |
@ErreMalote I can't tell. I have personally stopped maintaining v0.x for quite some time. |
@LeeKevin where can i add this code to my project? |
@bstumpexb You need to import the components first:
Make sure the prototype modifications are made before you render your React app. |
Thanks, worked like a charm. I added it to a separate file called 'preRender.js' and imported that file in the main app's 'index.js' file. edit: don't know how to make code formatting work (pressed insert code button and then pasted in code...) ` Popover.prototype.componentWillMount = function () {
} Popover.prototype.componentWillReceiveProps = function (nextProps) {
} |
@oliviertassinari Is there is proper solution to this issue? |
Add this file into your /src directory.
This will overwrite all the popver animations to start with opacity 0. Also fixes inline calendar having the same problem
|
Thank you @bstumpexb 👍 |
Wow its working Thanks @bstumpexb 💯 |
@bstumpexb Its a workaround so it can still cause issues. I just wanted to know from the team if they are working on a solution. |
We do no longer plan any work on v0.x. I'm closing the issue. We are definitely not proud of this issue, but we have limited resources. Things have been taken care of on v1. Thanks for the report. |
It works for me too when I had SelectField with MenuItems inside. When I added onFocus function to refresh items this flashing started to appear. After I add this hack solution everything works fine. Thanks man. |
In our Call-Em-All app, we still have this happening in a few places that are using v0.x. We have been surgically going through and upgrading the annoying portions (like this popover issue) to v1.x with much success. We have a massive project underway to switch all components to v1.x, but it definitely takes a while with hundreds of components in a large app. However, by using the v1.x |
Problem description
Popover component renders children before applying position styling. This results in a 'flash' of the popover in the top left corner (
x: 0, y:0
) before positioning correctly. This is caused by thesetPlacement
function being wrapped insetTimeout
. Removing the setTimeout wrapper resolves the issue. The timeout was added for this issue: #7663.Initial render 'flash':
Split second later, correctly positioned:
Versions
The text was updated successfully, but these errors were encountered: