Skip to content

Commit 26a4a90

Browse files
committed
pat selectbox: Minor optimization.
1 parent a6b8a7a commit 26a4a90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pat/selectbox/selectbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default Base.extend({
4848
},
4949

5050
change_select(el) {
51-
el.parentNode.setAttribute("data-option", el.querySelector("option:checked").text); // prettier-ignore
51+
el.parentNode.setAttribute("data-option", el.querySelector("option:checked")?.text || ''); // prettier-ignore
5252
el.parentNode.setAttribute("data-option-value", el.value);
5353
},
5454
});

0 commit comments

Comments
 (0)