Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Update documentation for <a> tag #1017

Closed
wants to merge 1 commit into from

Conversation

shreykejriwal
Copy link

If clicking on an element adds new content in the web page, we should still use <button> instead. As native <a> has properties like opening the link in new window or tab , this feature won't be helpful for loading the new content unless we change the url of the page.

Fixes # .

Changes proposed in this pull request:

If clicking on an element adds new content in the web page, we should still use `<button>` instead. As native `<a>` has properties like opening the link in new window or tab , this feature won't be helpful for loading the new content unless we change the url of the page.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no Contributor has not signed the CLA label Jun 19, 2019
@netlify
Copy link

netlify bot commented Jun 19, 2019

Deploy preview for web-dev-staging ready!

Built with commit 3148f7c

https://deploy-preview-1017--web-dev-staging.netlify.com

@robdodson
Copy link
Contributor

If clicking on an element adds new content in the web page, we should still use instead. As native has properties like opening the link in new window or tab , this feature won't be helpful for loading the new content unless we change the url of the page.

I think I can specify a bit more. I'm specifically talking about when folks are using anchors to do routing in a SPA. So in this case it would update the URL (and load new content).

@robdodson robdodson added eng - bug Something broke! P3 A "nice to have" or stretch goal. labels Jun 19, 2019
@robdodson
Copy link
Contributor

Created a bug to track this #1020. @shreykejriwal would you be interested in updating your PR to keep the original language but clarify that you can use an anchor if you're doing routing in a SPA.

Maybe something like:

If clicking on the element will navigate the user to a new page then use <a>. This includes if you're navigating within a SPA and using client-side routing to update the URL.

@robdodson robdodson self-assigned this Jun 27, 2019
@robdodson
Copy link
Contributor

Fixed in #1020

@robdodson robdodson closed this Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: no Contributor has not signed the CLA eng - bug Something broke! P3 A "nice to have" or stretch goal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants