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

chore(docs): Add onClick to SkipToContent in demos #11297

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

rebeccaalpert
Copy link
Member

@rebeccaalpert rebeccaalpert commented Dec 2, 2024

SkipToContent does not work in the context of the PatternFly page. Using document.getElementById sidesteps this issue and allows them to work as usual. I tried using refs, but because Page is an older class component, the refs were not compatible. We'd likely need to rewrite page as a function component. I'm not able to accomplish this in the short time before the end of the year. This is good enough for now, in my opinion.

SkipToContentBasic works as advertised, so I am not touching that, and I also did not touch react-integration or unit tests.

What: Closes #7554

SkipToContent does not work in the context of the PatternFly page. Using document.getElementById sidesteps this issue and allows them to work as usual. I tried using refs, but because Page is an older class component, the refs were not compatible. We'd likely need to rewrite page as a function component. This is good enough for now, in my opinion. SkipToContentBasic works as advertised, so I am not touching that, and I also did not touch react-integration or unit tests.
@patternfly-build
Copy link
Contributor

patternfly-build commented Dec 2, 2024

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Can we update the SkipToContent example as well?

@tlabaj tlabaj requested review from a team, tlabaj and kmcfaul and removed request for a team, tlabaj and kmcfaul December 3, 2024 20:46
Use refs in demo to match other demos.
@rebeccaalpert
Copy link
Member Author

rebeccaalpert commented Dec 3, 2024

Pushed an update to the skip to content so it uses an onClick. I wrapped the content in a Content component so it's styled appropriately. After consultation with Eric, also wrapped the content in a div so it would tab appropriately to the next link after you skip to content.

@thatblindgeye thatblindgeye merged commit 6411961 into patternfly:main Dec 4, 2024
13 checks passed
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.

Bug - Skip to content - focus remains at top of page in demos
4 participants