summaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2023-08-13 17:35:19 +0530
committerAkshay Nair <phenax5@gmail.com>2023-08-13 17:35:19 +0530
commit95602d1b1ac5668772d5d400270b4209ee19057b (patch)
tree21a5871bd0295cf311fb53e262658c0d7605a397 /src/index.ts
parent2c2bf0136a92b7ca49e7df952a44d9000a07fa8b (diff)
downloadcss-everything-95602d1b1ac5668772d5d400270b4209ee19057b.tar.gz
css-everything-95602d1b1ac5668772d5d400270b4209ee19057b.zip
fix: handles value attribute for set-attr
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index b737865..acbb360 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -89,7 +89,9 @@ const getEvalActions = (
},
setAttribute: async (id, name, value) => {
const $el = id ? document.getElementById(id) : $element
- if (value) {
+ if (name === 'value') {
+ ;($el as any).value = value
+ } else if (value) {
$el?.setAttribute(name, value)
} else {
$el?.removeAttribute(name)