From b29ae0df2854095904a1cecef7ab432bed23e07a Mon Sep 17 00:00:00 2001 From: scissorsneedfoodtoo Date: Wed, 27 Jun 2018 18:02:02 +0900 Subject: [PATCH] Removed the base tag from the header of the preview iframe. The href and target attributes were causing links within the iframe to open a new tab and would point to /, which created problems with some challenges where users should link to other page elements like a footer. Fixed an error found in QA where in-page anchors would work as expected in Chrome, but in FireFox would load another instance of Learn in the iframe. If the user goes back to the challenge, though, the in-page anchors work as expected. Readded and had it point to href='' to get in-page anchors working in both Chrome and FF. --- packages/learn/src/templates/Challenges/utils/frame.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/learn/src/templates/Challenges/utils/frame.js b/packages/learn/src/templates/Challenges/utils/frame.js index fa1dec6c38..972bce47e8 100644 --- a/packages/learn/src/templates/Challenges/utils/frame.js +++ b/packages/learn/src/templates/Challenges/utils/frame.js @@ -13,14 +13,17 @@ const mainId = 'fcc-main-frame'; const testId = 'fcc-test-frame'; // base tag here will force relative links -// within iframe to point to '/' instead of +// within iframe to point to '' instead of // append to the current challenge url +// this also allows in-page anchors to work properly +// rather than load another instance of the learn +// // if an error occurs during initialization // the __err prop will be set // This is then picked up in client/frame-runner.js during // runTestsInTestFrame below const createHeader = (id = mainId) => ` - +