Skip to content

Commit

Permalink
fix ref primitive value detection
Browse files Browse the repository at this point in the history
  • Loading branch information
benStre committed Oct 3, 2024
1 parent 615da57 commit 637e736
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions datex-bindings/dom-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,11 @@ export class DOMUtils {

// default attributes

const valid = this.setAttribute(element, attr, value.val, rootPath)
const currentVal = value.val;
const valid = this.setAttribute(element, attr, currentVal, rootPath)
// observe pointer value (TODO: this observe currently only works if value is a primitive pointer, otherwise only internal updates are reflected reactively, e.g. for style objects or arrays - this is handled in setAttribute)
if (value.is_js_primitive && valid) {
const isPrimitive = (typeof currentVal != "object" || currentVal === null) && typeof currentVal != "function";
if (isPrimitive && valid) {
const val = value;

weakAction({element},
Expand Down

0 comments on commit 637e736

Please sign in to comment.