We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 34b8d1e commit 39d6478Copy full SHA for 39d6478
samples/04.api/o.iframe-rpc-focus/webchat.html
@@ -67,15 +67,14 @@
67
return;
68
}
69
70
- const { type } = event.data ?? {};
+ const { type, target } = event.data ?? {};
71
72
- // Handle focus commands
73
if (type === 'WEBCHAT_FOCUS') {
74
try {
75
updateStatus('Focusing input...');
76
77
- if (window.WebChat) {
78
- const sendBoxInput = document.querySelector('.webchat__send-box input');
+ if (window.WebChat && target === 'sendBox') {
+ const sendBoxInput = document.querySelector('[data-id=webchat-sendbox-input]');
79
80
if (sendBoxInput) {
81
sendBoxInput.focus();
0 commit comments