Skip to content

Commit

Permalink
chore: remove erroneous focusable class, remove space from hidden men…
Browse files Browse the repository at this point in the history
…u group
  • Loading branch information
Najika Yoo committed Jul 26, 2023
1 parent 4f3a8e1 commit b23e97d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 37 deletions.
8 changes: 2 additions & 6 deletions packages/menu/src/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
html,
PropertyValues,
SizedMixin,
SpectrumElement,
TemplateResult,
} from '@spectrum-web-components/base';
import {
Expand All @@ -28,7 +29,6 @@ import type {
MenuItemRemovedEvent,
} from './MenuItem.js';
import menuStyles from './menu.css.js';
import { Focusable } from '@spectrum-web-components/shared';

export interface MenuChildItem {
menuItem: MenuItem;
Expand Down Expand Up @@ -61,7 +61,7 @@ function elementIsOrContains(
* When the `selects` attribute is not present a `value` will not be maintained and the Menu
* Item children of this Menu will not have their `selected` state managed.
*/
export class Menu extends SizedMixin(Focusable) {
export class Menu extends SizedMixin(SpectrumElement) {
public static override get styles(): CSSResultArray {
return [menuStyles];
}
Expand Down Expand Up @@ -96,10 +96,6 @@ export class Menu extends SizedMixin(Focusable) {
@query('slot:not([name])')
public menuSlot!: HTMLSlotElement;

public override get focusElement(): HTMLElement {
return this.menuSlot;
}

private childItemSet = new Set<MenuItem>();
public focusedItemIndex = 0;
public focusInItemIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/menu/src/MenuItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class MenuItem extends LikeAnchor(
private anchorElement!: HTMLAnchorElement;

public override get focusElement(): HTMLElement {
return this.anchorElement || this;
return this;
}

protected get hasIcon(): boolean {
Expand Down
30 changes: 1 addition & 29 deletions packages/menu/src/menu-group.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,6 @@ governing permissions and limitations under the License.
flex-direction: column;
}

/**
* The following corrects for positioning of the header when changing the
* direction of the content while https://github.com/adobe/spectrum-css/issues/794
* persists at the Spectrum CSS level.
*/

/* :host([dir='ltr']) .header {
padding: 0 var(--spectrum-global-dimension-size-450) 0
var(--spectrum-global-dimension-size-150);
}
:host([dir='rtl']) .header {
padding: 0 var(--spectrum-global-dimension-size-150) 0
var(--spectrum-global-dimension-size-450);
}
sp-menu {
--swc-menu-width: 100%;
}
:host(:last-child) sp-menu {
margin-bottom: 0;
}
:host(:first-child) .header[hidden] + sp-menu {
margin-top: 0;
}
[hidden] {
display: none !important;
} */
}
1 change: 0 additions & 1 deletion packages/menu/src/spectrum-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ const config = {
fileName: 'menu',
excludeByComponents: [
builder.class('spectrum-Menu-divider'),
// builder.class('spectrum-Menu-sectionHeading'),
builder.class('spectrum-menu-itemSelection'),
{
type: 'class',
Expand Down

0 comments on commit b23e97d

Please sign in to comment.