mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-22 07:49:38 +01:00
♻️ update setDeleteAttr for 'checked' and 'disabled'
This commit is contained in:
parent
ddfa3a2929
commit
864e349a1b
6
jsdom.js
6
jsdom.js
@ -3,9 +3,9 @@ import { prop_process } from './src/dom-common.js';
|
|||||||
const { setDeleteAttr }= prop_process;
|
const { setDeleteAttr }= prop_process;
|
||||||
/** @param {HTMLElement} obj */
|
/** @param {HTMLElement} obj */
|
||||||
prop_process.setDeleteAttr= function(obj, prop, value){
|
prop_process.setDeleteAttr= function(obj, prop, value){
|
||||||
if("checked"!==prop) return setDeleteAttr(obj, prop, value);
|
if("checked"!==prop && "disabled"!==prop) return setDeleteAttr(obj, prop, value);
|
||||||
if(value) return obj.setAttribute("checked", "");
|
if(value) return obj.setAttribute(prop, "");
|
||||||
obj.removeAttribute("checked");
|
obj.removeAttribute(prop);
|
||||||
};
|
};
|
||||||
const keys= [ "HTMLElement", "SVGElement", "DocumentFragment", "MutationObserver", "document" ];
|
const keys= [ "HTMLElement", "SVGElement", "DocumentFragment", "MutationObserver", "document" ];
|
||||||
let dom_last;
|
let dom_last;
|
||||||
|
Loading…
Reference in New Issue
Block a user