Skip to content

Commit

Permalink
fix update class attribute of input or textarea elements
Browse files Browse the repository at this point in the history
  • Loading branch information
leobm committed Oct 24, 2022
1 parent d45ff89 commit 58005be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/IHP/static/vendor/ihp-ssc.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ function evaluateAttributeOperation(domNode, op) {
// HtmlDiff passes attribute values as raw values — that is, if the attribute value is a single quote mark it'll be
// represented in HTML as """ and therefore we'll get """. We have to unescape those values before using
// 'setAttribute' or 'x.value = y'.
if (op.type === "UpdateAttribute" && inputTagnames.includes(domNode.tagName)) {
if (op.type === "UpdateAttribute" && op.attributeName == 'value' && inputTagnames.includes(domNode.tagName)) {
domNode.value = htmlDecode(op.attributeValue);
}
else if (op.type === 'UpdateAttribute' || op.type === 'AddAttribute') {
} else if (op.type === 'UpdateAttribute' || op.type === 'AddAttribute') {
domNode.setAttribute(op.attributeName, htmlDecode(op.attributeValue));
} else if (op.type === 'DeleteAttribute') {
domNode.removeAttribute(op.attributeName);
Expand All @@ -124,6 +123,7 @@ function evaluateAttributeOperation(domNode, op) {
}
}


function resolvePathToNode(component, path) {
var current = component;

Expand Down

0 comments on commit 58005be

Please sign in to comment.