361: Forks in a New Tab

Featured Imgs 23

If you Command (Mac) or Control (PC) click the Fork button, it will open the newly forked Pen in a new tab in your browser. That’s new behavior. Before, it would open the fork in the same tab, no matter how you click. That was unfortunate, as Cassie called out:

Why didn’t it work like this before? Well, that’s what Shaw and I get into in this podcast. It’s a smidge complicated. The root of it is that that Fork button isn’t a hyperlink. It’s a button handled by JavaScript because of the nature of how it works (a fork might have data that only the client knows about: unsaved code changes). But Shaw found a way to make it work anyway, by essentially passing the metaKey information through all the forking process until that moment we had an opportunity to open that new tab.

Time Jumps

  • 00:32 What was the request?
  • 03:37 Being careful with target="_blank"
  • 05:14 The whole forking process
  • 07:16 A form for example
  • 08:41 How forks work on a pen
  • 10:47 How did you pass the data?
  • 13:41 It’s behaving like a link
  • 15:29 Sponsor: Notion
  • 17:18 A few issues
  • 20:14 People forking instead of saving

Sponsor: Notion

Notion is an incredible organizational tool. Individuals can get a ton out of it, but I find the most benefit in making it a home base for teams. It can replace so many separate tools (documents, meeting notes, todos, kanbans, calendars, etc) that it really becomes the hub of doing work, and everything stays far more organized than disparate tools ever could.

The post 361: Forks in a New Tab appeared first on CodePen Blog.

Google Highlights Chrome 100 Improvements

Featured Imgs 23

Google’s release of Chrome 100 comes with a warning to website managers, a new API for enumerating the displays connected to a machine, a new API for improved User-Agent implementation, and more. This latest iteration is set for stable release on March 31st, 2022.

The Official DZone Style Guide

Featured Imgs 26

Welcome to DZone! 

This is the content style guide for user contributions on the site. A style guide is a document that lays out rules and guidelines to help maintain the tone and voice of the content across the site.