Jelajahi Sumber

change chat conversation (#1700)

* change chat conversation
resolves #1665

* toggle: label attribute

---------

Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
Fred Lefévère-Laoide 9 bulan lalu
induk
melakukan
16d2439dac

+ 1 - 4
frontend/taipy-gui/src/components/Taipy/Chat.tsx

@@ -305,10 +305,7 @@ const Chat = (props: ChatProps) => {
                 if (Array.isArray(nr) && nr.length > newValue.start && nr[newValue.start]) {
                     setRows((old) => {
                         old.length && nr.length > old.length && setShowMessage(true);
-                        if (nr.length < old.length) {
-                            return nr.concat(old.slice(nr.length));
-                        }
-                        if (old.length > newValue.start) {
+                        if (newValue.start > 0 && old.length > newValue.start) {
                             return old.slice(0, newValue.start).concat(nr.slice(newValue.start));
                         }
                         return nr;

+ 5 - 0
taipy/gui/viselements.json

@@ -273,6 +273,11 @@
                         "name": "mode",
                         "type": "str",
                         "doc": "Define the way the toggle is displayed:\n<ul><li>&quot;theme&quot;: synonym for setting the *theme* property to True</li></ul>"
+                    },
+                    {
+                        "name": "label",
+                        "type": "str",
+                        "doc": "The label associated with the toggle."
                     }
                 ]
             }