-
Notifications
You must be signed in to change notification settings - Fork 98
fix(ActionRow): align DOM and visual order in stacked mode #4271
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
base: release-23.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,3 +20,4 @@ www/public | |
|
|
||
| # Local Netlify folder | ||
| .netlify | ||
| .claude/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import React from 'react'; | ||
| import { render } from '@testing-library/react'; | ||
| import ActionRow from '.'; | ||
|
|
||
| describe('<ActionRow />', () => { | ||
| describe('stacked mode', () => { | ||
| it('renders children in reverse DOM order so primary action leads focus', () => { | ||
| const { getAllByRole } = render( | ||
| <ActionRow isStacked> | ||
| <button type="button">Secondary</button> | ||
| <button type="button">Primary</button> | ||
| </ActionRow>, | ||
| ); | ||
| const buttons = getAllByRole('button'); | ||
| expect(buttons[0]).toHaveTextContent('Primary'); | ||
| expect(buttons[1]).toHaveTextContent('Secondary'); | ||
| }); | ||
| }); | ||
|
|
||
| describe('horizontal mode', () => { | ||
| it('renders children in original DOM order', () => { | ||
| const { getAllByRole } = render( | ||
| <ActionRow> | ||
| <button type="button">Secondary</button> | ||
| <button type="button">Primary</button> | ||
| </ActionRow>, | ||
| ); | ||
| const buttons = getAllByRole('button'); | ||
| expect(buttons[0]).toHaveTextContent('Secondary'); | ||
| expect(buttons[1]).toHaveTextContent('Primary'); | ||
| }); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,15 +17,15 @@ | |
| display: flex; | ||
| flex-grow: 1; | ||
| align-items: center; | ||
| flex-direction: column-reverse; | ||
| flex-direction: column; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Changing Useful? React with 👍 / 👎.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @codex Does the change at line 28 of this file resolve this issue satisfactorily? |
||
| justify-content: center; | ||
|
|
||
| & > * { | ||
| margin: 0; | ||
| } | ||
|
|
||
| & > * + * { | ||
| margin-bottom: var(--pgn-spacing-action-row-gap-y); | ||
| margin-top: var(--pgn-spacing-action-row-gap-y); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about "claude" as the section comment here but I figure making it clear this isn't part of the "Local Netlify folder" would be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's your recommendation? I don't have a strong commitment to this change.