Skip to content

Commit

Permalink
fix: ifValue defaults to value or <prefix>-if-value
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Feb 22, 2024
1 parent 34c583b commit 74a35c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,16 @@ const CoCreateEvents = {
let elseCondition = element.getAttribute(`${prefix}-else`);

let ifValue = element.getAttribute(`${prefix}-if-value`)
if (ifValue || ifValue === "")
if (!ifValue && ifValue !== "")
ifValue = await element.getValue()
else if (ifValue || ifValue === "")
ifValue = [ifValue]
else
ifValue = values

if (!Array.isArray(ifValue))
ifValue = [ifValue]

//TODO: improved resize toggling of values
// let hasCondition = this.elements2.get(element)
if (ifCondition && evaluateCondition(ifCondition, ifValue)) {
Expand Down

0 comments on commit 74a35c5

Please sign in to comment.