diff --git a/source/dom/customelement.mjs b/source/dom/customelement.mjs index 6470a42d5bb932966ba40f0dcacb915084c42de1..b8af29a641e57c2a06e6de640dbf4c3e97bad75d 100644 --- a/source/dom/customelement.mjs +++ b/source/dom/customelement.mjs @@ -503,9 +503,11 @@ class CustomElement extends HTMLElement { if (isString(options)) { options = parseOptionsJSON.call(this, options); } + // 2024-01-21: remove this.defaults, otherwise it will overwrite + // the current settings that have already been made. + // https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/136 extend( this[internalSymbol].getSubject()["options"], - this.defaults, options, ); @@ -979,9 +981,12 @@ function getOptionsFromAttributes() { } /** + * Parses the given JSON data and returns the parsed object. + * * @private - * @param data - * @return {Object} + * @param {string} data The JSON data to be parsed. + * @returns {Object} The parsed object. + * @throws {error} Throws an error if the JSON data is not valid. */ function parseOptionsJSON(data) { let obj = {};