@microsoft/omnichannel-chat-widget 1.7.7-main.65ecd48 → 1.7.7-main.8517303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -5
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -5
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +7 -0
- package/package.json +1 -1
|
@@ -145,11 +145,6 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
// Move focus to the first button
|
|
149
|
-
const firstElement = (0, _utils.findAllFocusableElement)(`#${controlProps.id}`);
|
|
150
|
-
if (firstElement && firstElement[0]) {
|
|
151
|
-
firstElement[0].focus();
|
|
152
|
-
}
|
|
153
148
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
154
149
|
Event: _TelemetryConstants.TelemetryEvent.PrechatSurveyLoaded
|
|
155
150
|
});
|
|
@@ -158,6 +153,16 @@ const PreChatSurveyPaneStateful = props => {
|
|
|
158
153
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
159
154
|
});
|
|
160
155
|
}, []);
|
|
156
|
+
|
|
157
|
+
// Set focus to the first element
|
|
158
|
+
(0, _react.useEffect)(() => {
|
|
159
|
+
if (!state.appStates.isMinimized) {
|
|
160
|
+
const firstElement = (0, _utils.findAllFocusableElement)(`#${controlProps.id}`);
|
|
161
|
+
if (firstElement && firstElement[0]) {
|
|
162
|
+
firstElement[0].focus();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, [state.appStates.isMinimized]);
|
|
161
166
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.PreChatSurveyPane, {
|
|
162
167
|
controlProps: controlProps,
|
|
163
168
|
styleProps: styleProps
|
|
@@ -164,6 +164,13 @@ const WebChatContainerStateful = props => {
|
|
|
164
164
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
165
165
|
});
|
|
166
166
|
}, []);
|
|
167
|
+
|
|
168
|
+
// Set focus to the sendbox
|
|
169
|
+
(0, _react2.useEffect)(() => {
|
|
170
|
+
if (!state.appStates.isMinimized) {
|
|
171
|
+
(0, _utils.setFocusOnSendBox)();
|
|
172
|
+
}
|
|
173
|
+
}, [state.appStates.isMinimized]);
|
|
167
174
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
168
175
|
.webchat__stacked-layout__content .ac-pushButton {
|
|
169
176
|
cursor: pointer;
|
|
@@ -136,11 +136,6 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
// Move focus to the first button
|
|
140
|
-
const firstElement = findAllFocusableElement(`#${controlProps.id}`);
|
|
141
|
-
if (firstElement && firstElement[0]) {
|
|
142
|
-
firstElement[0].focus();
|
|
143
|
-
}
|
|
144
139
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
145
140
|
Event: TelemetryEvent.PrechatSurveyLoaded
|
|
146
141
|
});
|
|
@@ -149,6 +144,16 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
149
144
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
150
145
|
});
|
|
151
146
|
}, []);
|
|
147
|
+
|
|
148
|
+
// Set focus to the first element
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (!state.appStates.isMinimized) {
|
|
151
|
+
const firstElement = findAllFocusableElement(`#${controlProps.id}`);
|
|
152
|
+
if (firstElement && firstElement[0]) {
|
|
153
|
+
firstElement[0].focus();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, [state.appStates.isMinimized]);
|
|
152
157
|
return /*#__PURE__*/React.createElement(PreChatSurveyPane, {
|
|
153
158
|
controlProps: controlProps,
|
|
154
159
|
styleProps: styleProps
|
|
@@ -156,6 +156,13 @@ export const WebChatContainerStateful = props => {
|
|
|
156
156
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
157
157
|
});
|
|
158
158
|
}, []);
|
|
159
|
+
|
|
160
|
+
// Set focus to the sendbox
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (!state.appStates.isMinimized) {
|
|
163
|
+
setFocusOnSendBox();
|
|
164
|
+
}
|
|
165
|
+
}, [state.appStates.isMinimized]);
|
|
159
166
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
|
|
160
167
|
.webchat__stacked-layout__content .ac-pushButton {
|
|
161
168
|
cursor: pointer;
|