diff --git a/front_end/panels/recorder/components/SelectButton.test.ts b/front_end/panels/recorder/components/SelectButton.test.ts
index aff827891d..706ba99f41 100644
--- a/front_end/panels/recorder/components/SelectButton.test.ts
+++ b/front_end/panels/recorder/components/SelectButton.test.ts
@@ -3,7 +3,6 @@
// found in the LICENSE file.
import {renderElementIntoDOM} from '../../../testing/DOMHelpers.js';
-import * as Menus from '../../../ui/components/menus/menus.js';
import * as RenderCoordinator from '../../../ui/components/render_coordinator/render_coordinator.js';
import * as RecorderComponents from './components.js';
@@ -45,12 +44,11 @@ describe('SelectButton', () => {
await RenderCoordinator.done();
const dispatcherSpy = sinon.spy(component, 'dispatchEvent');
const selectMenu = component.shadowRoot?.querySelector(
- 'devtools-select-menu',
+ 'select',
);
assert.exists(selectMenu);
- selectMenu.dispatchEvent(
- new Menus.SelectMenu.SelectMenuItemSelectedEvent('item1'),
- );
+ selectMenu.value = 'item1';
+ selectMenu.dispatchEvent(new Event('change'));
dispatcherSpy.calledOnceWithExactly(
RecorderComponents.SelectButton.SelectMenuSelectedEvent as unknown as sinon.SinonMatcher);
diff --git a/front_end/panels/recorder/components/SelectButton.ts b/front_end/panels/recorder/components/SelectButton.ts
index 4c919ce61b..bdc5f67e7f 100644
--- a/front_end/panels/recorder/components/SelectButton.ts
+++ b/front_end/panels/recorder/components/SelectButton.ts
@@ -7,9 +7,9 @@ import '../../../ui/components/menus/menus.js';
import * as Platform from '../../../core/platform/platform.js';
import type {LocalizedString} from '../../../core/platform/UIString.js';
import * as Buttons from '../../../ui/components/buttons/buttons.js';
-import * as Dialogs from '../../../ui/components/dialogs/dialogs.js';
import * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';
-import type * as Menus from '../../../ui/components/menus/menus.js';
+// eslint-disable-next-line rulesdir/es-modules-import
+import inspectorCommonStylesRaw from '../../../ui/legacy/inspectorCommon.css.js';
import * as Lit from '../../../ui/lit/lit.js';
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
import * as Models from '../models/models.js';
@@ -17,6 +17,10 @@ import type * as Actions from '../recorder-actions/recorder-actions.js';
import selectButtonStylesRaw from './selectButton.css.js';
+// TODO(crbug.com/391381439): Fully migrate off of constructed style sheets.
+const inspectorCommonStyles = new CSSStyleSheet();
+inspectorCommonStyles.replaceSync(inspectorCommonStylesRaw.cssText);
+
// TODO(crbug.com/391381439): Fully migrate off of constructed style sheets.
const selectButtonStyles = new CSSStyleSheet();
selectButtonStyles.replaceSync(selectButtonStylesRaw.cssText);
@@ -114,7 +118,7 @@ export class SelectButton extends HTMLElement {
};
connectedCallback(): void {
- this.#shadow.adoptedStyleSheets = [selectButtonStyles];
+ this.#shadow.adoptedStyleSheets = [inspectorCommonStyles, selectButtonStyles];
void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
}
@@ -174,26 +178,29 @@ export class SelectButton extends HTMLElement {
}
#handleSelectMenuSelect(
- evt: Menus.SelectMenu.SelectMenuItemSelectedEvent,
+ evt: Event,
): void {
- this.dispatchEvent(new SelectMenuSelectedEvent(evt.itemValue as string));
- void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
+ if (evt.target instanceof HTMLSelectElement) {
+ this.dispatchEvent(new SelectMenuSelectedEvent(evt.target.value as string));
+ void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#render);
+ }
}
#renderSelectItem(
item: SelectButtonItem,
selectedItem: SelectButtonItem,
): Lit.TemplateResult {
+ const selected = item.value === selectedItem.value;
// clang-format off
return html`
-