Skip to content

Clean up focus-trap constructor #2079

@bryanpizzillo

Description

@bryanpizzillo

Issue description

ESTIMATE TBD

The options element in the focus-trap.ts constructor below should either be:

  1. a parameter not named options as it is a single option, and it should be a default parameter. public constructor(element: HTMLElement, focusableElements: string = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])') {
  2. Make public constructor(element: HTMLElement, { focusableElements = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'}) {

Code:

	public constructor(element: HTMLElement, options?: string) {
		this.element = element;
		this.focusableElements =
			options ||
			"button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])";
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions