Opened 8 years ago
Last modified 8 days ago
#27692 assigned Bug
Remember scroll position in list screen after coming back from edit screen - remove autofocus from search field
Reported by: | Ciske Boekelo | Owned by: | SAI GANESH S |
---|---|---|---|
Component: | contrib.admin | Version: | 1.10 |
Severity: | Normal | Keywords: | Remember scroll position autofocus search field |
Cc: | Tom Carrick, SAI GANESH S | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When coming back to the list screen from the edit screen, the browser normally remembers your scroll position and restores it. This is desirable behavior if you want to work through a long lists of objects.
However, when you include a search field in the list screen, it has autofocus enabled, which prevents the scroll position from being restored. This is annoying and unhelpful. This is new behavior since django 1.9 I believe.
I suggest removing the autofocus, but I'm open to other suggestions (making it customizable somehow for example)
Change History (7)
comment:1 by , 8 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 8 years ago
Thanks for your swift reply, Graham!
Would you like me to ask the question on the Django Developers Mailing List or have/will you?
comment:4 by , 8 years ago
I just found out that's it not new behavior in Django 1.9. The javascript autofocus that existed previously has the same effect. This doesn't change my request though, I'd still like the autofocus to be either removed or optional.
comment:5 by , 13 months ago
Cc: | added |
---|
comment:6 by , 9 days ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:7 by , 8 days ago
Observation 1: I scroll down, click on an object to edit, and return without making any edits (i.e., without clicking "Save"). The scroll position is preserved.
Observation 2: I scroll down, click on an object to edit, and return after making edits (i.e., by clicking "Save"). The scroll position is not preserved.
I read through the conversation and inspected the search bar in Chrome DevTools. I found that the autofocus attribute is set to false.
If I'm missing something, could someone guide me on which part of the code I should be looking into?
I think that was done in 1.10 as part of removing inline JavaScript d638cdc42acec608c1967f44af6be32a477c239f (#25165). I guess it would be fine to remove
autofocus
although I'd like to see if anyone on the DevelopersMailingList has input.