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

feat(JumpLinks): consumed Penta updates #10027

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

thatblindgeye
Copy link
Contributor

What: Closes #9994

Additional issues:

import { JumpLinksList } from './JumpLinksList';

export interface JumpLinksItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'onClick'> {
/** Whether this item is active. Parent JumpLinks component sets this when passed a `scrollableSelector`. */
isActive?: boolean;
/** Href for this link */
href?: string;
href: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to be required, as without it the anchor internal to the component cannot receive keyboard focus.

If the intent is that a consumer can pass either an href to link to an ID on the page, or the onClick to handle this functionality themselves, then we would need to render either an anchor with an href or a button with the onClick, not an anchor with either/both.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make a codemod to at least warn consumers about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<span className={styles.jumpLinksLinkText}>{children}</span>
</a>
<span className={styles.jumpLinksLink}>
<a className={css(buttonStyles.button, buttonStyles.modifiers.link)} href={href} onClick={onClick}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passed the classes in instead of using Button with props just to retain the onClick event type. No strong opinion about this, so I can just update the onClick event type and use the Button component proper here instead if we want.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would update this to use the Button if possible.

@patternfly-build
Copy link
Contributor

patternfly-build commented Jan 19, 2024

@thatblindgeye thatblindgeye linked an issue Jan 22, 2024 that may be closed by this pull request
@thatblindgeye thatblindgeye requested review from a team, nicolethoen, mfrances17, andrew-ronaldson, lboehling and srambach and removed request for a team January 22, 2024 15:55
Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

It'd be nice to do a v6 org bump once this merges, then the jumplinks used navigate between examples in the docs can have the same hover styles in the workspace.

Copy link
Collaborator

@andrew-ronaldson andrew-ronaldson left a comment

Choose a reason for hiding this comment

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

sweet moves. Done like dinner.

Copy link
Member

@srambach srambach left a comment

Choose a reason for hiding this comment

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

Beautiful 🤹

<span className={styles.jumpLinksLinkText}>{children}</span>
</a>
<span className={styles.jumpLinksLink}>
<a className={css(buttonStyles.button, buttonStyles.modifiers.link)} href={href} onClick={onClick}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I would update this to use the Button if possible.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@tlabaj tlabaj merged commit 783e3e3 into patternfly:v6 Feb 13, 2024
13 checks passed
@patternfly-build
Copy link
Contributor

Your changes have been released in:

  • @patternfly/react-code-editor@6.0.0-alpha.30
  • @patternfly/react-core@6.0.0-alpha.30
  • @patternfly/react-docs@7.0.0-alpha.31
  • @patternfly/react-drag-drop@6.0.0-alpha.11
  • demo-app-ts@5.1.1-alpha.29
  • @patternfly/react-table@6.0.0-alpha.30

Thanks for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consume core updates: Jump links
7 participants