-
Notifications
You must be signed in to change notification settings - Fork 420
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
Remove any use of javascript:
URLs
#2514
Conversation
Replaced with `href="#"` and `event.preventDefault()` as suggested in https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md#case-i-understand-the-previous-cases-but-still-need-an-element-resembling-a-link-that-is-purely-clickable
Thanks for opening this pull request! 💯 This is a community-driven project, and we can't do it without your participation. Please check out our contributing guidelines and review the Contributor Checklist if you haven't already, to make sure everything is squared away. TravisCI will take about 10 minutes to run through the same items that are on the Contributor checklist with a pass/fail check below. Please fix any issues that cause TravisCI to fail or ask for clarification--we try, but sometimes the errors can be unclear. |
Thanks for the contribution! Before we can merge this, we need @xoob to sign the Salesforce.com Contributor License Agreement. |
Snapshot tests are failing. Is it okay to just refresh the snapshots? Anything I should look out for? |
Awesome, thanks for taking this up! Sorry for the delay in reviewing. I'll take a look within the next few days. |
@garygong, any more feedback about these changes? I'd like to get them merged before continuing on TypeScript compatibility... |
Sorry, I lot track of this. I'll look at this in the next day or so! |
@xoob The changes look good to me! Thanks for taking this on! Testing: Running A11y Instead of:
Use:
|
This issue has been automatically marked as stale, because it has not had recent activity. It will be closed if no further activity occurs. Maintainers are responsible for tech debt and project health. This is most likely a new components or component feature request. Please submit a pull request for or request feedback on this feature. Thank you. |
I'll continue to work on this here: #2829 |
Fixes #2384 and #2493
Additional description
This maintenance change provides compatibility with React DOM 16.9, which introduced a deprecation warning for
javascript:
URLs in facebook/react#15047:<a href="javascript:void(0)">
with<a href="#" onClick={(event) => event.preventDefault()}>
as suggested in False-positive security precaution warning (javascript:
URLs) facebook/react#16382EventUtil.trappedHandler()
utility to simplify the process of cancelling the event for an optional handler.href === '#'
conditional cancellation to some components, so they conform with prior behavior.Changes have been smoke tested but require more detailed testing before they can be merged.
To-Do
Test that all changed components are working as expected. We need instructions from the maintainer where to start and what to look for.
Discuss a11y warnings with maintainer.
npm test
now throws these warnings:CONTRIBUTOR checklist (do not remove)
Please complete for every pull request
npm run lint:fix
has been run and linting passes.components/component-docs.json
CI tests pass (npm test
).REVIEWER checklist (do not remove)
components/component-docs.json
tests.Required only if there are markup / UX changes
last-slds-markup-review
inpackage.json
and push.last-accessibility-review
, topackage.json
and push.npm run local-update
within locally cloned site repo to confirm the site will function correctly at the next release.