Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Children container has wrong initial absolute left #182

Open
martin-braun opened this issue Mar 4, 2019 · 0 comments
Open

Children container has wrong initial absolute left #182

martin-braun opened this issue Mar 4, 2019 · 0 comments

Comments

@martin-braun
Copy link

martin-braun commented Mar 4, 2019

I'm following the responsive example, doing this on componentDidMount:

	public componentDidMount(): void {
		this.setState({
			docked: this.mql.matches
		});
	}

It ends up to set the style of the children container to position: absolute; top: 0px; left: 190px; right: 0px; bottom: 0px; overflow-y: auto; transition: left 0.3s ease-out 0s, right 0.3s ease-out 0s; in my case, that has not the right left property:

screenshot 2019-03-04 at 20 06 52

as soon as I resize so it undocks and docks again, the CSS is changed to position: absolute; top: 0px; left: 203px; right: 0px; bottom: 0px; overflow-y: auto; transition: left 0.3s ease-out 0s, right 0.3s ease-out 0s; which looks like it should:

screenshot 2019-03-04 at 20 07 04

This problem can be bypassed by setting docked a little bit later, so it draws twice:

	public componentDidMount(): void {
		setTimeout(() => {
			this.setState({
				docked: this.mql.matches
			});
		}, 10);
	}

That's dirty tho. I tried to set the defaultSideBarWidth without success.

Here is a snapshot of the entire DOM when this happens: https://jsfiddle.net/61nv3ch4/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant