Skip to content

Commit b694f94

Browse files
committed
feat(card): Report state on page load, too
1 parent 543c5b8 commit b694f94

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

srcts/src/components/card.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,15 @@ class Card {
192192

193193
private _setShinyInput(): void {
194194
if (!this.card.classList.contains(Card.attr.CLASS_SHINY_INPUT)) return;
195-
if (!Shiny || !Shiny.setInputValue) return;
195+
if (!Shiny) return;
196+
if (!Shiny.setInputValue) {
197+
if (Shiny.shinyapp) {
198+
Shiny.shinyapp.taskQueue.enqueue(() => this._setShinyInput());
199+
} else {
200+
setTimeout(() => this._setShinyInput(), 0);
201+
}
202+
return;
203+
}
196204
Shiny.setInputValue(this.card.id, {
197205
// eslint-disable-next-line @typescript-eslint/naming-convention
198206
full_screen:

0 commit comments

Comments
 (0)