Skip to content

Commit

Permalink
Fix: Active template is not highlighted properly in list view. (#62811)
Browse files Browse the repository at this point in the history
Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
  • Loading branch information
3 people authored and gutenbergplugin committed Jun 25, 2024
1 parent 00633da commit 4a047d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/edit-site/src/components/page-templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ function Preview( { item, viewType } ) {

export default function PageTemplates() {
const { params } = useLocation();
const { activeView = 'all', layout } = params;
const { activeView = 'all', layout, postId } = params;
const [ selection, setSelection ] = useState( [ postId ] );

const defaultView = useMemo( () => {
const usedType = layout ?? DEFAULT_VIEW.type;
return {
Expand Down Expand Up @@ -369,6 +371,8 @@ export default function PageTemplates() {
view={ view }
onChangeView={ onChangeView }
onSelectionChange={ onSelectionChange }
selection={ selection }
setSelection={ setSelection }
/>
</Page>
);
Expand Down

0 comments on commit 4a047d4

Please sign in to comment.