Skip to content

Commit

Permalink
Handle updating URL for selected icon and moving to page top
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Jul 24, 2024
1 parent 48891b1 commit 4f3195c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4f3195c

Please sign in to comment.