dmed-voice-assistant 1.2.8 → 1.2.9
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/dist/recognition.js +14 -1
- package/package.json +1 -1
package/dist/recognition.js
CHANGED
@@ -89,6 +89,7 @@ const Recognition = _ref4 => {
|
|
89
89
|
const [voiceList, setVoiceList] = (0, _react.useState)([]);
|
90
90
|
const languageList = ['Auto-Detect', 'English', 'Chinese (Simplified)'];
|
91
91
|
const [selectedLanguage, setSelectedLanguage] = (0, _react.useState)(0);
|
92
|
+
const recognitionBoxRef = (0, _react.useRef)(null);
|
92
93
|
const recognitionRef = (0, _react.useRef)(null);
|
93
94
|
const mediaRecorderRef = (0, _react.useRef)(null);
|
94
95
|
const [result, setResult] = (0, _react.useState)([]);
|
@@ -325,6 +326,11 @@ const Recognition = _ref4 => {
|
|
325
326
|
(0, _react.useEffect)(() => {
|
326
327
|
setHistoryList(recognitionHistoryList);
|
327
328
|
}, [recognitionHistoryList]);
|
329
|
+
(0, _react.useEffect)(() => {
|
330
|
+
if (result.length > 0 && recognitionBoxRef.current) {
|
331
|
+
recognitionBoxRef.current.scrollTop = recognitionBoxRef.current.scrollHeight;
|
332
|
+
}
|
333
|
+
}, [result]);
|
328
334
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
329
335
|
className: "bg-white rounded-[5px] p-[20px] w-[440px]",
|
330
336
|
sx: {
|
@@ -465,10 +471,17 @@ const Recognition = _ref4 => {
|
|
465
471
|
})]
|
466
472
|
})]
|
467
473
|
}), isStarted && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
474
|
+
ref: recognitionBoxRef,
|
468
475
|
className: "flex items-center flex-wrap space-x-1 mt-1 p-[9px]",
|
469
476
|
sx: {
|
470
477
|
maxWidth: "387px",
|
471
|
-
|
478
|
+
maxHeight: "100px",
|
479
|
+
overflowX: "hidden",
|
480
|
+
overflowY: "scroll",
|
481
|
+
scrollbarWidth: "none",
|
482
|
+
"&::-webkit-scrollbar": {
|
483
|
+
display: "none"
|
484
|
+
}
|
472
485
|
},
|
473
486
|
children: result.map((item, index) => {
|
474
487
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|