Skip to content

Commit

Permalink
feat: allow "checked" condition to be set
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur authored and kevinchappell committed Aug 30, 2020
1 parent ff69967 commit 1df926f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export const CONDITION_INPUT_ORDER = [

export const FIELD_PROPERTY_MAP = {
value: 'attrs.value',
checked: 'attrs.checked',
...visiblityConfigs,
}

Expand Down
6 changes: 3 additions & 3 deletions src/js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ export default class FormeoRenderer {
notContains: (source, target) => !source.includes(target),
}

const sourceValue = evt.target[sourceProperty]
const targetValue = isAddress(target) ? this.getComponent(target)[targetProperty] : target

// Compare as string, this allows values like "true" to be checked for properties like "checked".
const sourceValue = String(evt.target[sourceProperty])
const targetValue = String(isAddress(target) ? this.getComponent(target)[targetProperty] : target)
return comparisonMap[comparison] && comparisonMap[comparison](sourceValue, targetValue)
}

Expand Down

0 comments on commit 1df926f

Please sign in to comment.