-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Quick Docs content jumps to top when resizing document window #4830
Comments
As noted at the EC issue, I looked into this and failed. No scroll events are being fired, and no JavaScript is explicitly setting the |
It looks like the inline widget's DOM subtree may be getting removed & readded when the CM widget is refreshed. This might be causing Chrome to forget the scroll position. A similar thing happens when you scroll the inline widget too far out of view and then scroll back... |
Here's a JSFiddle that demonstrates that effect: http://jsfiddle.net/RXdab/ Even an instantaneous, temporary removal from the DOM (click "No op") loses the scroll pos, at least in Chrome... |
(CC @njx for kicks) Thanks for helping track this down! Sadly, I am still not smart enough to solve this. My only guess was to watch for |
@njx -It would be great if we could have this for the preview 6 release, but we would need this for this Brackets sprint 30 - unrealistic timeframe it seems, right? |
It doesn't seem likely we could fix this within the next day or two, since (from my cursory read of the issue) I think we'd probably need something in CodeMirror. It's probably hard to avoid having CM remove/add the widget on a refresh, but perhaps we could get Marijn to add an event that's dispatched when the widget node is readded. |
Hmmm...that wouldn't really help with the flickering issue @iwehrman mentioned though. It's really a bummer that the scroll position is lost when the node is detached. Is it possible that that's a bug in Chrome? Worth seeing what other browsers do. |
@peterflynn's fiddle exhibits the same behavior in Chrome, Safari and Firefox. I suspect that this is somehow intentional given that you can't set |
@njx I think we'd need events both when the node is removed and when re-added -- to save & restore scroll state, respectively. Does the widget lose focus too if it had it? That'd be another thing we might want to save/restore using those same events down the road... |
Marking "F Quick Edit" even though this isn't strictly the same feature, since it's related to the same underlying infrastructure (inline widgets). |
Description:
Quick Docs jumps to the top when resizing document window. This also happens with the inline color editor when using the new Kuler feature. See Edge Code bug https://git.corp.adobe.com/edge/edge-code/issues/266
Repro using Brackets Sprint 29 on Win 7 & Mac 10.8.
Repro steps:
body {
-webkit-box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}
Actual results:
Quick Docs content jumps to top when resizing document window.
Expected results:
Quick Docs content stays on the content section you were on when resizing document window.
Workaround:
Scroll back to the content section you were looking at.
The text was updated successfully, but these errors were encountered: