From 4f3195ca687e314f071cf3b9158a7a6e168647c3 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Wed, 24 Jul 2024 17:50:04 +0200 Subject: [PATCH] Handle updating URL for selected icon and moving to page top --- .../themes/wporg-developer-2023/src/dashicons-page/view.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/wp-content/themes/wporg-developer-2023/src/dashicons-page/view.js b/source/wp-content/themes/wporg-developer-2023/src/dashicons-page/view.js index a6610f1f..59a98ee1 100644 --- a/source/wp-content/themes/wporg-developer-2023/src/dashicons-page/view.js +++ b/source/wp-content/themes/wporg-developer-2023/src/dashicons-page/view.js @@ -32,7 +32,12 @@ const { state } = IAPI.store( 'wporg/dashicons-page', { }, handleIconClick: () => { + const icon = IAPI.getContext().icon; state.selectedIcon = [ IAPI.getContext().icon ]; + const url = new URL( document.location.href ); + url.searchParams.set( 'icon', icon ); + window.history.replaceState( undefined, undefined, url ); + document.location.hash = '#glyph'; }, /** @param {InputEvent} event */