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:

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 (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 4 months ago.

Download all attachments as: .zip

Change History (9)

@iandunn
3 years ago

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

@iandunn
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.


2 years ago
#2

  • Keywords has-patch added; needs-patch removed

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

Yeora commented on PR #844:


2 years ago
#5

@iandunn Thank you for your suggestions for improvement :)

@faisalahammad
4 months ago

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

Note: See TracTickets for help on using tickets.