Skip to content

Commit 847ed4e

Browse files
committed
playground: fix readonly state
1 parent 35a0c5b commit 847ed4e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

site/src/playground/js/modules/itiController.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ function applyInputAttributes(state, telInput) {
1414
}
1515

1616
telInput.disabled = Boolean(state.disabled);
17-
telInput.readonly = Boolean(state.readonly);
17+
const isReadOnly = Boolean(state.readonly);
18+
telInput.readOnly = isReadOnly;
19+
// Keep the HTML attribute in sync for visibility in devtools.
20+
if (isReadOnly) {
21+
telInput.setAttribute("readonly", "");
22+
} else {
23+
telInput.removeAttribute("readonly");
24+
}
1825
}
1926

2027
function destroyInstance(iti) {

0 commit comments

Comments
 (0)