Page MenuHomePhabricator

Enhance mobile interactions for autocomplete selection fields in upload wizard
Closed, ResolvedPublic

Description

This ticket is part of the EPIC T383055

Problems to investigate

  • The auto zoom feature upon selecting the category field cuts off both the input field and autocomplete list on the right hand side as shown in the video. This issue will also affect the visibility of arrows proposed in T383720 to allow users to navigate to subcategories. Investigate how we can fix this component so that it does not auto zoom.
  • The current autocomplete list is not scrollable and abruptly disappears upon scrolling down as shown in the video. As part of the work in T383721 which is to allow users to scroll through more matches we need to enable scrolling within the autocomplete list. However, since mobile has limited space we need to investigate how to move towards a more ideal experience such as
    1. Scrolling the categories field to the top of the page when the input is in focus so that there is enough space between the field and keyboard to see autocomplete items
    2. Moving the categories field partially off the screen once there are x no. of categories added so that there is enough space left the field and keyboard to see autocomplete items
    3. Enabling scrolling within the auto complete list
    4. Hiding the keyboard when the user scrolls through the autocomplete list
    5. Investigating if the height of the autocomplete list can be dynamically updated based on available space on the screen
    6. ...... (add any other topics of investigation here)

Concept video

Event Timeline

So... mobile browsers tend to auto-zoom input fields when the font size is below 16px. That's behavior that isn't easily disabled for certain fields, but I found a bit of a hack around it, by disabling zooming altogether (on the entire page) on keypress, and reinstating the original behavior as soon on focus. The auto-zoom seems to happen right in between these 2 events (at least on iOS; have no Android to test with), so it effectively disables the automatic zoom for that particular field, without interfering with other fields, or the user's ability to manually zoom afterwards.

2nd thing, in addition to zooming, is that mobile browsers (at least on iOS) tend to center the input field; once again slightly annoying when we want to add the autocomplete menu. We can just scroll the input field (along with its title so that context is not lost) to the top of the viewport, in order to have as much room for the autocomplete as possible - at least definitely have a good chunk of it in view.

I have a patch ready for both of those.


Other ideas in the description:

  1. Moving the categories field partially off the screen once there are x no. of categories added so that there is enough space left the field and keyboard to see autocomplete items

^ While this may make autocomplete selection somewhat easier, it makes it harder to go back to the input field itself and make changes there, or start a new search.

  1. Enabling scrolling within the auto complete list

^ Already done

  1. Hiding the keyboard when the user scrolls through the autocomplete list

^ This would be very hacky, but may also be rather annoying for users IMO, as they would then have to figure out how to get it back (i.e. clicking the input field again) if they want to further refine their search after all

  1. Investigating if the height of the autocomplete list can be dynamically updated based on available space on the screen

^ Also potentially annoying for those who do have very limited space. If we don't move the input off of the screen, we may have very limited height; if we do, we may annoy them in case they want to go back to the input field. IMO just showing the full screen and letting them move the page around a bit for however they can most optimally view the autocomplete menu, rather than deciding for them how we rearrange the page as they interact with it.

Change #1122583 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/UploadWizard@master] Categories selection improvements on mobile

https://gerrit.wikimedia.org/r/1122583

matthiasmullie renamed this task from [SPIKE] Investigate ways to enhance mobile interactions for autocomplete selection fields in upload wizard to Investigate ways to enhance mobile interactions for autocomplete selection fields in upload wizard.Feb 25 2025, 1:35 PM
matthiasmullie renamed this task from Investigate ways to enhance mobile interactions for autocomplete selection fields in upload wizard to Enhance mobile interactions for autocomplete selection fields in upload wizard.
matthiasmullie claimed this task.

Thanks @matthiasmullie for starting work on this. The highest priority was to fix the auto-zoom so its great that we have a solution. Also good that we are able to scroll the input field to the top of the viewport it will make a good difference in the available space.

#2 we can skip this requirements as you make a good point and since we have the scrolling enabled we don't need to do this.
#4 this one I think depends on user behaviour whether they start browsing before finishing typing or do they finish typing and then browse. It is hard to know that. However, I think since we have increased the number of items in the drop-down it might be more beneficial to hide the keyboard when the user scrolls. I would assume one would keep typing until they see relevant results popping up before starting to scroll.
#5 I think not changing the size means part of the auto-complete may be hidden behind the keyboard. Is that so? If so then I think more reasons to hide keyboard when scrolling in auto-complete. Tapping on input to bring it back is intuitive.

Btw, I recently downloaded the Android Studio on my computer and installed a virtual device manager... its working well for testing things in Android environment.

I would assume one would keep typing until they see relevant results popping up before starting to scroll.

I'm not entirely convinced about that - I can easily imagine someone beginning to type something up, start scrolling relevant-looking results, and either not immediately find what they're looking for, or get more inspiration to further refine their search.

Anyway; I've also made the keyboard go away when scrolling - we can always switch back should there be any complaints (although I think it's really a big deal either way :p)

Change #1122583 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@master] Categories selection improvements on mobile

https://gerrit.wikimedia.org/r/1122583

Etonkovidova subscribed.

Checked on cpmmons beta on iPhone - here is the link to the video.
Looks good

  • the Categories field doesn't have the auto zoom
  • categories traversing happens as usual (no jumping or going off the list)
  • the list of categories displays the vertical horizontal bar if you scroll the list

Re-checked the above scenario on commons wmf.19 - all looks as expected.