Make WordPress Core

Opened 4 years ago

Last modified 2 months ago

#51884 new enhancement

Events Widget: There isn't a UI for clearing the selected city

Reported by: iandunn's profile iandunn Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.2.2
Component: Administration Keywords:
Focuses: ui Cc:

Description

If someone has manually selected a city in the Events Widget, there isn't an obvious way for them to clear that selection through the UI. They can manually change it to another city, but they can't go back to where the city would be automatically determined by IP geolocation.


Side note: One workaround is to enter an invalid city, like narnia, and then refresh the page.

Attachments (4)

clear link-button.png (174.7 KB) - added by iandunn 4 years ago.
Rough idea: add an extra link-button with text like "clear"
x icon.png (162.2 KB) - added by iandunn 4 years ago.
Rough idea: Add an x icon
51884.diff (11.4 KB) - added by faisalahammad 19 months ago.
Screenshot 2024-07-06 at 7.28.28 PM.png (35.1 KB) - added by alh0319 2 months ago.
Screenshot of proposed changes to location settings in Events and News Widget

Download all attachments as: .zip

Change History (13)

@iandunn
4 years ago

Rough idea: add an extra link-button with text like "clear"

@iandunn
4 years ago

Rough idea: Add an x icon

#1 @iandunn
4 years ago

The above screenshots show a few potential solutions. I think they'd still need some work to communicate to people how "clear" is different than "cancel", or what happens when they click "x".

Most people probably aren't aware, or don't remember, that the widget initially selected their location for them. So they might be unsure about those buttons would do, and hesitant to click them.

Last edited 4 years ago by iandunn (previous) (diff)

This ticket was mentioned in PR #844 on WordPress/wordpress-develop by Yeora.


4 years ago
#2

  • Keywords has-patch added; needs-patch removed

#3 @mabipress
4 years ago

Hello :)
This is my first contribution to WordPress.
I skipped the AJAX PHP Unit test.
I tried to write a test with the _handleAjax Method , unfortunately it didn't work as I had imagined. (it only "mimics" the ajax request)

How do I test AJAX calls?

Thanks :)

#4 @mabipress
4 years ago

OKAY. I figured out how it works.
I had to update my dependencies.
With npm run watch.
Now PHPUnit tests are also included :)

Last edited 4 years ago by mabipress (previous) (diff)

Yeora commented on PR #844:


4 years ago
#5

@iandunn Thank you for your suggestions for improvement :)

#6 @faisalahammad
19 months ago

  • Version set to trunk

The patch allows you to add a cross/dismiss icon to the WordPress Events and News widget. After you set a location, it enables you to reset the location with a single click. The patch worked flawlessly, giving us a thumbs up!

https://i.ibb.co/vB8dgVh/SCR-20230217-m40.png

This ticket was mentioned in PR #6815 on WordPress/wordpress-develop by @tibi.buzdugan.


3 months ago
#7

  • Add a button to reset the selected location
  • Focus user on the city input after clicking the select location button

#8 @alh0319
2 months ago

I would like to propose a different design for clearing the location. I don't believe that an X on its own is sufficiently clear and may result in confusion for some users.

I think two changes should be made:

  1. Reword the "Select Location" button to "Change Location" - this more clearly explains that the collapsed section can be used to change the location either by submitting a city or removing it. (I always find it odd that it says "select" when a select/dropdown is not present and it's not actually a select UI.)
  1. Add a "Clear Location" button next to the cancel button to the right of the form (with a dashicon).

Here is a design showing what I have in mind:

Screenshot of proposed changes to location settings in Events and News Widget

Last edited 2 months ago by alh0319 (previous) (diff)

@alh0319
2 months ago

Screenshot of proposed changes to location settings in Events and News Widget

#9 @Subrata Deb Nath
2 months ago

  • Keywords good-first-bug needs-design has-patch removed
  • Version changed from 6.2 to 6.2.2

User interfaces significantly impact the overall user experience. The current design for selecting or clearing a location, using an 'X' to clear and "Select Location" as a button text, may not be clear to all users. To address this, I propose the following improvements:

Input Field: Allows users to enter a new city name.
Save Location Button: Saves the new location.
Cancel Button: Closes the modal without making changes.

https://i.imgur.com/uMq8q8V.png

Note: See TracTickets for help on using tickets.