Skip to content

Conversation

@heyMP
Copy link
Contributor

@heyMP heyMP commented Jan 18, 2022

Removing the public focus() method causes an error in the following test:
Enter should exit open dialog and move focus to the dropdown.. Meaning that when you're focused on the list item and you click Enter on an action item it needs to programatically move the focus to pfe-dropdown. Knowing that, I added a private _focus() method to programmatically move the focus to the button.

<pfe-dropdown>
  #shadowRoot
    <button>

@changeset-bot
Copy link

changeset-bot bot commented Jan 18, 2022

⚠️ No Changeset found

Latest commit: 3675aa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@heyMP heyMP requested a review from bennypowers January 18, 2022 21:44
@github-actions github-actions bot added functionality Functionality, typically pertaining to the JavaScript. tests Related to testing AT passed Automated testing has passed labels Jan 18, 2022
return item.shadowRoot?.querySelector(`.pfe-dropdown-item__container`) ?? null;
}

// move focus to the button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// move focus to the button
/** Move focus back to the button after closing the dropdown */


// move focus to the button
private _focus():void {
this.shadowRoot?.querySelector<HTMLButtonElement>('#pfe-dropdown-toggle')?.focus();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.shadowRoot?.querySelector<HTMLButtonElement>('#pfe-dropdown-toggle')?.focus();
this.button?.focus();

@bennypowers bennypowers merged commit 65443e1 into pfe-tools/pfe-dropdown Jan 19, 2022
@bennypowers bennypowers deleted the pfe-tools/pfe-dropdown--focus-api-change branch January 19, 2022 07:49
bennypowers added a commit that referenced this pull request Jan 24, 2022
fix(dropdown): compose UI events

test(dropdown): e2e tests

test(dropdown): fix types in e2e tests

style(dropdown): lint

test(dropdown): e2e tests with page object model

test(dropdown): build demo with optional shadowroot

docs(dropdown): rearrange docs urls

docs(dropdown): inline docs

docs(dropdown): refactor docs page

docs(dropdown): add changeset

docs(dropdown): update inline docs

chore: updated docs for download items

feat: switched to options in docs. Added public expanded property. Updated tests

fix: prev next keyboard actions for items

fixed keyboard navigation. added tests to cover a11y tests

added better tests, weeded out race conditions

chore: fix types

fix: add guard for item clicks

chore: update types

style(dropdown): whitespace changes

fix(dropdown): remove extra focus() method

fix(dropdown): use focus-within in item

fix(dropdown): moved public focus method to private. (#1851)

test(dropdown): pick nits in dropdown tests

Co-Authored-By: Michael Potter <[email protected]>
bennypowers added a commit that referenced this pull request Jan 30, 2022
fix(dropdown): compose UI events

test(dropdown): e2e tests

test(dropdown): fix types in e2e tests

style(dropdown): lint

test(dropdown): e2e tests with page object model

test(dropdown): build demo with optional shadowroot

docs(dropdown): rearrange docs urls

docs(dropdown): inline docs

docs(dropdown): refactor docs page

docs(dropdown): add changeset

docs(dropdown): update inline docs

chore: updated docs for download items

feat: switched to options in docs. Added public expanded property. Updated tests

fix: prev next keyboard actions for items

fixed keyboard navigation. added tests to cover a11y tests

added better tests, weeded out race conditions

chore: fix types

fix: add guard for item clicks

chore: update types

style(dropdown): whitespace changes

fix(dropdown): remove extra focus() method

fix(dropdown): use focus-within in item

fix(dropdown): moved public focus method to private. (#1851)

test(dropdown): pick nits in dropdown tests

Co-Authored-By: Michael Potter <[email protected]>

fix(dropdown): add {{version}} to element classes

docs(dropdown): use pfe-styles

Co-Authored-By: Steven Spriggs <[email protected]>

feat(dropdown): add CSS shadow parts
bennypowers added a commit that referenced this pull request Jan 30, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Jan 30, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Jan 30, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Jan 31, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 1, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 1, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 1, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 3, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 3, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 3, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 3, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 3, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 3, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 3, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 11, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 22, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 23, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
bennypowers added a commit that referenced this pull request Feb 23, 2022
**Features**
- switched to options in docs. Added public expanded property. Updated tests
- add CSS shadow parts

**Fixes**

- compose UI events
  - rename `pfeEvent` to `deprecatedCustomEvent`
- remove extra focus() method
- use focus-within in item
- moved public focus method to private. (#1851)
- add {{version}} to element classes
- add guard for item clicks
- prev next keyboard actions for items
  - fixed keyboard navigation. added tests to cover a11y tests
  - added better tests, weeded out race conditions

**Tests**

- e2e tests
- fix types in e2e tests
- e2e tests with page object model
- build demo with optional shadowroot
- pick nits in dropdown tests

**Docs**

- rearrange docs urls
- inline docs
- add changeset
- use pfe-styles

Co-Authored-By: Michael Potter <[email protected]>
Co-Authored-By: Steven Spriggs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AT passed Automated testing has passed functionality Functionality, typically pertaining to the JavaScript. tests Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants