Skip to content

Commit 76dbce7

Browse files
fix: only set 'disabled' and 'readonly' if doesn't exist(#75)
* fix: disabled attribute was lost (#63) * docs: update changelog for #63 Co-authored-by: Thomas Licht <thomas.licht@octasys.de> Co-authored-by: Michael Bøcker-Larsen <mbl@code.boutique> Closes #63
1 parent bd154d1 commit 76dbce7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## next
44

5+
## 0.15.4
6+
7+
- fix: change 'disabled' and 'readonly' if not set (#63)
8+
59
## 0.15.3
610

711
- types: changed base type from VueConstructor to Vue (#71)

src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,14 @@ const VueAcl: VueAcl = {
224224
const not = binding.modifiers.not
225225

226226
const el_ = el as LooseHTMLElement
227-
el_.disabled = false
228-
el_.readOnly = false
227+
228+
if (!el.hasAttribute('disabled')) {
229+
el_.disabled = false
230+
}
231+
232+
if (!el.hasAttribute('readOnly')) {
233+
el_.readOnly = false
234+
}
229235

230236
if ((ok && not) || (!ok && !not)) {
231237
if (behaviour === 'hide') {

0 commit comments

Comments
 (0)