Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: interactive tile expand button #16644

Merged

Conversation

lee-chase
Copy link
Member

Interactive tile expand button ignores spacebar press.

Changelog

InteractiveTile expand/close

Testing / Reviewing

Buttons should be operable via the spacebar. In the existing code the expand/collapse of the interactive tile has this disabled to cope with text box usage.

This PR processes the keypress to check that it is targeting the expand button.

@lee-chase lee-chase requested a review from a team as a code owner June 3, 2024 13:57
@lee-chase lee-chase requested review from alisonjoseph and guidari June 3, 2024 13:57
Copy link

netlify bot commented Jun 3, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit e304b91
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/668bee473324990009e47cf5
😎 Deploy Preview https://deploy-preview-16644--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 3, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit e304b91
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/668bee472ef4150008d94e83
😎 Deploy Preview https://deploy-preview-16644--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@alisonjoseph alisonjoseph left a comment

Choose a reason for hiding this comment

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

This LGTM, should we add a test around this?

Copy link
Contributor

@guidari guidari left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

To add some tests you can use this as an example.

  • Add a new Tab;
  • Change the selector;
  • Change from Enter to Space

test('@avt-keyboard-nav SelectableTile', async ({ page }) => {
await visitStory(page, {
component: 'SelectableTile',
id: 'components-tile--selectable',
globals: {
theme: 'white',
},
});
await expect(page.locator('body')).toBeFocused();
await page.keyboard.press('Tab');
await expect(page.locator('#selectable-tile-1')).toBeFocused();
await page.keyboard.press('Enter');
await expect(page.locator('#selectable-tile-1')).toHaveClass(
'cds--tile cds--tile--selectable cds--tile--is-selected'
);
});

@tay1orjones
Copy link
Member

@lee-chase would you be up for adding tests to this?

@tay1orjones tay1orjones removed status: needs tests PRs that need tests labels Jul 2, 2024
Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

I've added the necessary tests and corrected some that were failing

@tay1orjones tay1orjones added this pull request to the merge queue Jul 8, 2024
Merged via the queue into carbon-design-system:main with commit d9e9bae Jul 8, 2024
21 of 22 checks passed
@lee-chase lee-chase deleted the fixInteractiveTileExpand branch July 8, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants