Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ecfbf24
Use `Select` for remaining `SelectControl` `variant="minimal"` call s…
mirka Sep 16, 2026
99ac856
Changelog: Link #83035 on the Select migrations
mirka Sep 16, 2026
7ff3c3f
Raise the DataViews filter operator Select above the filter popover
mirka Sep 16, 2026
5e2a6d2
Merge origin/trunk into replace-minimal-select-control
mirka Sep 30, 2026
04869ee
Merge remote-tracking branch 'origin/trunk' into HEAD
mirka Oct 1, 2026
f9d1fd2
Merge remote-tracking branch 'origin/trunk' into HEAD
mirka Oct 1, 2026
4852829
Merge origin/trunk into replace-minimal-select-control
mirka Oct 5, 2026
7f0a827
Merge origin/trunk into replace-minimal-select-control
mirka Oct 5, 2026
1f9595e
Update e2e tests for minimal Select controls
mirka Oct 6, 2026
3720474
Keep pagination e2e fix scoped to Select migration
mirka Oct 6, 2026
02304e6
Merge origin/trunk into replace-minimal-select-control
mirka Oct 7, 2026
132ecb6
Simplify Select tests and remove legacy overrides
mirka Oct 7, 2026
7b82d57
Inline color format selection in browser tests
mirka Oct 7, 2026
203112f
Enable overlay compatibility for DataViews filters
mirka Oct 7, 2026
ecffc56
Separate DataViews overlay opt-in from Select migration
mirka Oct 7, 2026
ba5f98f
Merge latest trunk into minimal Select migration
mirka Oct 13, 2026
3c40b76
Constrain pagination Select popups to the available viewport
mirka Oct 13, 2026
11acc71
Resolve filter operator labels through Select items
mirka Oct 13, 2026
823e4df
Preserve filter operator shrinking for long field names
mirka Oct 13, 2026
d259bef
Explain pagination Select positioning overrides
mirka Oct 13, 2026
aa3dc1f
Simplify ColorPicker Select label and styling composition
mirka Oct 14, 2026
77030ab
Remove pagination Select scrolling workarounds
mirka Oct 14, 2026
243ffc3
Preserve pagination Select trigger typography
mirka Oct 16, 2026
cb5a27d
Merge remote-tracking branch 'origin/trunk' into HEAD
mirka Oct 16, 2026
48d830a
Fix ColorPicker Select stacking in legacy overlays
mirka Oct 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

### Enhancements

- `ColorPicker`: Use `Select` from `@wordpress/ui` for the color format selector ([#83035](https://github.com/WordPress/gutenberg/pull/83035)).
- `ExternalLink`: Use a small border radius for consistent focus rings ([#84697](https://github.com/WordPress/gutenberg/pull/84697)).
- `Menu`: Use WPDS motion tokens for popup transition durations and slide easing ([#84706](https://github.com/WordPress/gutenberg/pull/84706)).
- `TabPanel`: Add interaction backgrounds to unselected tabs, preserve keyboard focus rings, and size neutral vertical selection lines to the content ([#84572](https://github.com/WordPress/gutenberg/pull/84572)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { render } from 'vitest-browser-react';
import { useState } from '@wordpress/element';
import { logged } from '@wordpress/deprecated';
import ColorPalette from '..';
import '../../popover/style.scss';

const EXAMPLE_COLORS = [
{ name: 'red', color: '#f00' },
Expand Down Expand Up @@ -245,6 +246,44 @@ describe( 'ColorPalette', () => {
expect( container ).toBeEmptyDOMElement();
} );

it( 'keeps the color format selector above the ColorPalette popup and returns focus after dismissal', async () => {
const user = userEvent.setup();
delete (
window as Window & { __wpUiCompatOverlaySlotEnabled?: boolean }
).__wpUiCompatOverlaySlotEnabled;
await render( <ControlledColorPalette /> );
const pickerTrigger = screen.getByRole( 'button', {
name: /^Custom color picker/,
} );
await user.click( pickerTrigger );
const formatTrigger = screen.getByRole( 'combobox', {
name: 'Color format',
} );
await user.click( formatTrigger );
const hslOption = screen.getByRole( 'option', { name: 'HSL' } );
await waitFor( () => {
const { x, y, width, height } = hslOption.getBoundingClientRect();
expect(
hslOption.contains(
document.elementFromPoint( x + width / 2, y + height / 2 )
)
).toBe( true );
} );
await user.click( hslOption );
expect(
screen.getByRole( 'spinbutton', { name: 'Hue (HSL H value)' } )
).toBeVisible();
expect( pickerTrigger ).toHaveAttribute( 'aria-expanded', 'true' );
await waitFor( () => expect( formatTrigger ).toHaveFocus() );
await user.click( formatTrigger );
await user.keyboard( '{Escape}' );
await waitFor( () => expect( formatTrigger ).toHaveFocus() );
expect(
screen.queryByRole( 'option', { name: 'HSL' } )
).not.toBeInTheDocument();
expect( pickerTrigger ).toHaveAttribute( 'aria-expanded', 'true' );
} );

it( 'should render dropdown and its content', async () => {
const user = userEvent.setup();
const onChange = vi.fn();
Expand Down
42 changes: 30 additions & 12 deletions packages/components/src/color-picker/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
} from '@wordpress/element';
import { useDebounce } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';
import { Select, useEnableWpCompatOverlaySlot } from '@wordpress/ui';
import { useContextSystem, contextConnect } from '../context';
import SelectControl from '../select-control';
import { HStack } from '../h-stack';
import { Flex } from '../flex';
import { PolymorphicElement } from '../utils/polymorphic-element';
Expand Down Expand Up @@ -52,6 +52,8 @@ const UnconnectedColorPicker = (
props: ColorPickerProps,
forwardedRef: ForwardedRef< any >
) => {
useEnableWpCompatOverlaySlot();

const {
enableAlpha = false,
color: colorProp,
Expand Down Expand Up @@ -209,18 +211,34 @@ const UnconnectedColorPicker = (
/>
<div className={ styles.auxiliary }>
<HStack className={ styles.header } justify="space-between">
<SelectControl
className={ styles.select }
size="compact"
options={ options }
<Select.Root
items={ options }
value={ colorType }
onChange={ ( nextColorType ) =>
setColorType( nextColorType as ColorType )
}
label={ __( 'Color format' ) }
hideLabelFromVision
variant="minimal"
/>
onValueChange={ ( nextColorType ) => {
if ( nextColorType !== null ) {
setColorType( nextColorType );
}
} }
>
<Select.Trigger
size="compact"
variant="minimal"
aria-label={ __( 'Color format' ) }
className={ styles.select }
/>
<Select.Popup width="content">
{ options.map( ( option ) => (
<Select.Item
key={ option.value }
value={ option.value }
>
<Select.ItemLabel>
{ option.label }
</Select.ItemLabel>
</Select.Item>
) ) }
</Select.Popup>
</Select.Root>
<ColorCopyButton
color={ safeColordColor }
colorType={ copyFormat || colorType }
Expand Down
Loading
Loading