dmed-voice-assistant 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- overflow: "hidden"
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, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dmed-voice-assistant",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"