Skip to content

Commit

Permalink
Change initial value of shouldPersist to false to avoid setting stora…
Browse files Browse the repository at this point in the history
…ge before DOMContentLoaded (#127)

* Change initial value of shouldPersist to false to avoid setting storage before DOMContentLoaded

* Dist files
  • Loading branch information
FanFataL authored May 25, 2022
1 parent b4dd2f8 commit 1fa9216
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/what-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ return /******/ (function(modules) { // webpackBootstrap
var currentTimestamp = Date.now();

// check for a `data-whatpersist` attribute on either the `html` or `body` elements, defaults to `true`
var shouldPersist = 'false';
var shouldPersist = false;

// form input types
var formInputs = ['button', 'input', 'select', 'textarea'];
Expand Down Expand Up @@ -233,7 +233,7 @@ return /******/ (function(modules) { // webpackBootstrap
// checks if input persistence should happen and
// get saved state from session storage if true (defaults to `false`)
var setPersist = function setPersist() {
shouldPersist = !(docElem.getAttribute('data-whatpersist') || document.body.getAttribute('data-whatpersist') === 'false');
shouldPersist = !(docElem.getAttribute('data-whatpersist') === 'false' || document.body.getAttribute('data-whatpersist') === 'false');

if (shouldPersist) {
// check for session variables and use if available
Expand Down Expand Up @@ -514,4 +514,4 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ })
/******/ ])
});
;
;
2 changes: 1 addition & 1 deletion dist/what-input.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1fa9216

Please sign in to comment.