Make WordPress Core

Opened 3 years ago

Last modified 4 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
Component: Administration Keywords: good-first-bug needs-design has-patch
Focuses: ui Cc:


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 (3)

clear link-button.png (174.7 KB) - added by iandunn 3 years ago.
Rough idea: add an extra link-button with text like "clear"
x icon.png (162.2 KB) - added by iandunn 3 years ago.
Rough idea: Add an x icon
51884.diff (11.4 KB) - added by faisalahammad 15 months ago.

Download all attachments as: .zip

Change History (9)

3 years ago

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

3 years ago

Rough idea: Add an x icon

#1 @iandunn
3 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 3 years ago by iandunn (previous) (diff)

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

3 years ago

  • Keywords has-patch added; needs-patch removed

#3 @mabipress
3 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
3 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 3 years ago by mabipress (previous) (diff)

Yeora commented on PR #844:

3 years ago

@iandunn Thank you for your suggestions for improvement :)

#6 @faisalahammad
15 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!

Note: See TracTickets for help on using tickets.