From 74e5a2db4d05040ab8b98c07cb8a84be576c0f8a Mon Sep 17 00:00:00 2001 From: Matt Levy Date: Tue, 6 Oct 2020 17:29:43 +0100 Subject: [PATCH] fix: clear outlet before rendering --- CHANGELOG.md | 5 +++++ package-lock.json | 2 +- package.json | 2 +- src/util/render-outlet.js | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f10128c..5c562b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.1] - 2020-10-06 + +### Fixed +- Ensure an outlet is clear before rendering contents + ## [1.1.0] - 2020-09-30 ### Fixed diff --git a/package-lock.json b/package-lock.json index a465043..8d668a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ficusjs-router", - "version": "1.0.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 503e7b7..f5db9c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ficusjs-router", - "version": "1.1.0", + "version": "1.1.1", "description": "Lightweight standalone client-side router that supports history and hash routing", "main": "dist/router.js", "module": "dist/router.js", diff --git a/src/util/render-outlet.js b/src/util/render-outlet.js index 32a85e8..f24e000 100644 --- a/src/util/render-outlet.js +++ b/src/util/render-outlet.js @@ -5,6 +5,7 @@ */ import { elementFromString } from './element-from-string.js' import { isElement } from './is-element.js' +import { elementEmpty } from './element-empty.js' export function renderOutlet (what, where) { // check for an outlet @@ -27,6 +28,7 @@ export function renderOutlet (what, where) { } } + elementEmpty(outlet) outlet.appendChild(element) // set the data attribute so we can clear the outlet later