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

Absolute positioning and resize #431

Closed
krikunts opened this issue May 29, 2015 · 15 comments
Closed

Absolute positioning and resize #431

krikunts opened this issue May 29, 2015 · 15 comments
Milestone

Comments

@krikunts
Copy link
Member

This issue is related to the choices positioning and adaptive design (like Bootstrap).
Because of absolute positioning, introduced in 61e54ee the choices are not properly rendered.
If you resize the browser or scroll window while displaying choices all the elements change their positions but choices don't.

@jpic
Copy link
Member

jpic commented May 29, 2015

So it should be fine if we call fixPosition on browser scroll or resize ?

It's a bit annoying I recon, but we've got to go through that to have sufficient material to convince the django dev community that the admin should move from overflow: hidden to using .clearfix to clear floats.

@jpic
Copy link
Member

jpic commented May 29, 2015

BTW could you make a PR for your example if you'd like to help us support this on the long run ?

@krikunts
Copy link
Member Author

I think it could work but can't say for sure, as I don't understand your event handling quite right to do it.
I made PR with my example app.

@jpic
Copy link
Member

jpic commented May 29, 2015

Could you try with 2.2.0rc5 please ?

Thanks !

@krikunts
Copy link
Member Author

2.2.0rc5 works ok with modal dialog but it breaks with common autocomplete input because it sets this.container equals to autocomplete input itself

@jpic
Copy link
Member

jpic commented May 29, 2015

Oops ! How do you suggest we improve that ? After all, we could just let
users specify the container manually but it would be better to try to
figure it automatically of course.
Le 29 mai 2015 16:57, "Tatiana" notifications@github.com a écrit :

2.2.0rc5 works ok with modal dialog but it breaks with common autocomplete
input because it sets this.container equals to autocomplete input itself


Reply to this email directly or view it on GitHub
#431 (comment)
.

@krikunts
Copy link
Member Author

Sorry, I didn't notice that with modal 2.2.0rc5 choices don't respond to resizes and scrolls just like before, so it doesn't help at all.
Maybe solution with resize and scroll event handling you mentioned before will do better.

@jpic
Copy link
Member

jpic commented May 29, 2015

What browsers do you have that won't make the input loose focus, causing
the autocomplete to hide and that problem go away ?

For scrolling, I think it's a lot better to just start from the right
container instead of re calculating the position from the wrong container
over and over again.

About that other way, there should be a branch in my fork with an example,
but I didn't like it so much.

If we can't find a right way to support this then it would make sense to
just hide the autocomplete since the user is probably not using it anymore
when resizing or scrolling what do you think ?
Le 29 mai 2015 17:07, "Tatiana" notifications@github.com a écrit :

Sorry, I didn't notice that with modal 2.2.0rc5 choices don't respond to
resizes and scrolls just like before, so it doesn't help at all.
Maybe solution with resize and scroll event handling you mentioned before
will do better.


Reply to this email directly or view it on GitHub
#431 (comment)
.

@krikunts
Copy link
Member Author

I have Firefox 37.0.1 and Chromium 41.0.2272.76 on Linux Mint 17.
I finally found out that rc5 solves the problem with modal dialog scrolling so we should fix just resizing and self-container problems.
What if we just use input's direct parent as a container or it'll break something?
The input loses focus while switching between maximized and normal window but saves focus during manual dragging-resize. I see that choices are in the right place when I continue typing after resize so maybe hiding autocomplete is ok.

@jpic
Copy link
Member

jpic commented May 29, 2015

On Fri, May 29, 2015 at 6:40 PM, Tatiana notifications@github.com wrote:

I have Firefox 37.0.1 and Chromium 41.0.2272.76 on Linux Mint 17.
I finally found out that rc5 solves the problem with modal dialog
scrolling so we should fix just resizing and self-container problems.

I'm glad we're having the same results !

What if we just use input's direct parent as a container or it'll break
something?

Well if the direct parent has overflow: hidden I'm affraid it might be
hidden. We should really just append it in the right block formatting
context but it's a concept I'm still trying to completely figure out.

The input loses focus while switching between maximized and normal window
but saves focus during manual dragging-resize.

Ok, what happens exactly on resize / focus might even be specific to the
relation between the browser and the window manager.

I see that choices are in the right place when I continue typing after
resize so maybe hiding autocomplete is ok.

Here's the other way I was talking about, calling fixPosition on resize /
scroll. Calling fixPosition on resize sounds ok, but on scroll it was
really hacky.

It seemed better to let scrolling work naturally in case the user is on a
weird device where she has to scroll to see the complete list of choices.

@jpic
Copy link
Member

jpic commented May 29, 2015

Note that I found this.container to be empty in django admin, not equal to this.input. I wonder how you got this.container to be equal to this.input, since this.container gets calculated depending on a traversal of this.input.parents(), could you double check please ?

2.2.0rc6 fixes django admin support with 5f744a9, simply by defaulting to <body> for container. That's why I really like the clearfix way of positioning I think I'm starting to have enough material to defend a case in Django maybe for Django 1.9 or 2.0 ^^

Could you try 2.2.0rc6 and let me know if it fixes all your open issues or if there's still a problem.

Thanks a lot for your help, really appreciated B)

@jpic jpic closed this as completed in 20bdbe1 May 29, 2015
@jpic
Copy link
Member

jpic commented May 29, 2015

Oops, this was closed by mistake.

Try 2.2.0rc7 please, I had forgotten the resize fix in 2.2.0rc6 ^^

Thanks a heap, I think we're good to go now B)

@jpic jpic reopened this May 29, 2015
@krikunts
Copy link
Member Author

I moved from my Linux at work to Windows home machine and testing on it. For rc7 everything is ok except for scroll in modal dialog (maybe it's just for Windows). Resize part is working great now.

@jpic
Copy link
Member

jpic commented May 29, 2015

Unfortunately I won't see my CSS friends before the 15th so if anybody
could share a fix until then it'd rock.

Thanks a heap for your time
Le 29 mai 2015 20:42, "Tatiana" notifications@github.com a écrit :

I moved from my Linux at work to Windows home machine and testing on it.
For rc7 everything is ok except for scroll in modal dialog (maybe it's just
for Windows). Resize part is working great now.


Reply to this email directly or view it on GitHub
#431 (comment)
.

@jpic
Copy link
Member

jpic commented Jun 1, 2015

Could you tell what browser version you tested it with in windows ? In issue #438 please which is the followup.

@jpic jpic closed this as completed Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants