<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: NumberInput Field Not updated in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/230167#M662</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/12008"&gt;@gilgi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have some update from the team for you. The examples in our reference we have with the react-hook-form and useState hook have the same problem. And the way to go is, as also mentioned in the &lt;A href="https://react-hook-form.com/get-started#IntegratingwithUIlibraries" target="_blank"&gt;react hook form docs&lt;/A&gt;, to use Controllers.&lt;/P&gt;
&lt;P&gt;Here you have a &lt;A href="https://codesandbox.io/p/devbox/strato-text-number-input-forked-gwvxc6?file=%2Fsrc%2FApp.tsx%3A12%2C8-12%2C18" target="_blank"&gt;codebox sample with NumberInput field&lt;/A&gt;. That is the way you also need to adapt your code.&lt;/P&gt;
&lt;P&gt;Updating the code examples in our reference will take some time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
    <pubDate>Tue, 28 Nov 2023 16:06:40 GMT</pubDate>
    <dc:creator>sinisa_zubic</dc:creator>
    <dc:date>2023-11-28T16:06:40Z</dc:date>
    <item>
      <title>NumberInput Field Not updated</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229757#M647</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe I've lost all ideas and would appreciate your help. I have a form that includes both Text Inputs and NumberInputs.&lt;/P&gt;&lt;P&gt;Wheneever a state value changes and I set the a textInput value appropriately it happens immediatly. Whenever I'm changing a NumberInput field value, I only see the change when the field gets focus. Search Dr. Google and React Hook Forms as well and could not find any more ideas.&lt;/P&gt;&lt;P&gt;Anything you can think of?&lt;/P&gt;&lt;P&gt;Gil.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 08:49:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229757#M647</guid>
      <dc:creator>gilgi</dc:creator>
      <dc:date>2023-11-23T08:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: NumberInput Field Not updated</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229770#M648</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/12008"&gt;@gilgi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could not reproduce your problem. I tried it out locally and also in &lt;A href="https://codesandbox.io/p/devbox/reverent-sound-x67lr7?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clpb100nz0008356il9wtss92%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clpb100nz0003356ix27z4oiv%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clpb100nz0005356iytimg0dp%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clpb100nz0007356ib2kkogzg%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clpb100nz0003356ix27z4oiv%2522%253A%257B%2522id%2522%253A%2522clpb100nz0003356ix27z4oiv%2522%252C%2522tabs%2522%253A%255B%255D%257D%252C%2522clpb100nz0007356ib2kkogzg%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clpb100nz0006356i5yyv6208%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A5173%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clpb100nz0007356ib2kkogzg%2522%252C%2522activeTabId%2522%253A%2522clpb100nz0006356i5yyv6208%2522%257D%252C%2522clpb100nz0005356iytimg0dp%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clpb100nz0004356id721f9vy%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522clpb100nz0005356iytimg0dp%2522%252C%2522activeTabId%2522%253A%2522clpb100nz0004356id721f9vy%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D" target="_self"&gt;code sandbox&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here my code snippet&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import { Button, FormField, Grid, NumberInput, Page, TextInput } from "@dynatrace/strato-components-preview";
import React, { useState } from "react";

export default function App() {
  const [textValue, setTextValue] = useState("initial value");
  const [numValue, setNumValue] = useState&amp;lt;number&amp;gt;(0)

  const changeValues = () =&amp;gt; {
    setNumValue(Math.random());
    setTextValue("text value - " + Math.random());
  }

  return (
    &amp;lt;Page&amp;gt;
      &amp;lt;Page.Main&amp;gt;
        &amp;lt;Grid
          width="50%"
          gridTemplateAreas="'input' 'control'"
        &amp;gt;
          &amp;lt;Grid gridItem gridArea="input"&amp;gt;
            &amp;lt;FormField label="myformfield"&amp;gt;
              &amp;lt;TextInput placeholder="text input" value={textValue} /&amp;gt;
              &amp;lt;NumberInput placeholder="number input" value={numValue} /&amp;gt;
            &amp;lt;/FormField&amp;gt;
          &amp;lt;/Grid&amp;gt;
          &amp;lt;Grid gridItem gridArea="control"&amp;gt;
            &amp;lt;Button variant="accent" onClick={changeValues}&amp;gt;change&amp;lt;/Button&amp;gt;
          &amp;lt;/Grid&amp;gt;
        &amp;lt;/Grid&amp;gt;
      &amp;lt;/Page.Main&amp;gt;
    &amp;lt;/Page&amp;gt;
  );
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you maybe share your code snippet here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 10:12:25 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229770#M648</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-11-23T10:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: NumberInput Field Not updated</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229776#M649</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;My Form field is defined as follows&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;FormField label={&amp;lt;StyledLabel htmlFor="relativeWeight" required&amp;gt;Relative Weight&amp;lt;/StyledLabel&amp;gt;}&amp;gt;
                        &amp;lt;NumberInput id="relativeWeight" 
                                    placeholder="e.g. 1.5" 
                                    controlState={{
                                        state: errors.relativeWeight ? 'error' : 'valid',
                                        hint:
                                          errors.relativeWeight?.message ||
                                          'Please enter the this component relative weight compared to its sieblings.',
                                      }}
                                    value={relativeWeight}
                                    {...register('relativeWeight', {
                                        required: {
                                          value: true,
                                          message: 'Please enter this component relative weight.',
                                        },
                                        min: {
                                            value: 1,
                                            message: 'We do not support values lower than 1',
                                          },
                                      })}
                                      onChange={(value) =&amp;gt; {
                                        setRelativeWeight(value);
                                        setValue('relativeWeight', value, { shouldValidate: true });
                                        haloAppContext.setEntityModified(true);
                                      }}
                                    /&amp;gt;
                    &amp;lt;/FormField&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;I'm also using&amp;nbsp;&lt;SPAN&gt;react-hook-form.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The fuield Is defined as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    var [relativeWeight, setRelativeWeight] = useState&amp;lt;number | null&amp;gt;(1);&lt;/LI-CODE&gt;&lt;P&gt;and Setting is value using the setRelativeWeight doesn't change the display.&lt;/P&gt;&lt;P&gt;The weird thing is that when I place the mouse in the field itself and it gets the focus, than the value changes.&lt;/P&gt;&lt;P&gt;gil.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 10:33:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229776#M649</guid>
      <dc:creator>gilgi</dc:creator>
      <dc:date>2023-11-23T10:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: NumberInput Field Not updated</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229790#M651</link>
      <description>&lt;P&gt;not sure what the issue is here. We have just tried it in&amp;nbsp;&lt;A href="https://codesandbox.io/p/devbox/strato-text-number-input-forked-gwvxc6?file=%2Fsrc%2FApp.tsx%3A49%2C3&amp;amp;layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clpb7xb430009356jsoq5g7aj%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clpb7xb420004356jrtspivn6%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clpb7xb420006356jpurs5ath%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clpb7xb430008356jinm82oav%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clpb7xb420004356jrtspivn6%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clpb7xb420003356jjx3ph9b3%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A49%252C%2522startColumn%2522%253A3%252C%2522endLineNumber%2522%253A49%252C%2522endColumn%2522%253A3%257D%255D%252C%2522filepath%2522%253A%2522%252Fsrc%252FApp.tsx%2522%257D%255D%252C%2522id%2522%253A%2522clpb7xb420004356jrtspivn6%2522%252C%2522activeTabId%2522%253A%2522clpb7xb420003356jjx3ph9b3%2522%257D%252C%2522clpb7xb430008356jinm82oav%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clpb7xb430007356j6d2q520m%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A5173%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clpb7xb430008356jinm82oav%2522%252C%2522activeTabId%2522%253A%2522clpb7xb430007356j6d2q520m%2522%257D%252C%2522clpb7xb420006356jpurs5ath%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clpb7xb420005356j5mocxofo%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522clpb7xb420006356jpurs5ath%2522%252C%2522activeTabId%2522%253A%2522clpb7xb420005356j5mocxofo%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D" target="_self"&gt;codesandbox, please have a look&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kudos to&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/7207"&gt;@thomas_heller&lt;/a&gt;&amp;nbsp;for the quick reproducer.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 13:21:48 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229790#M651</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-11-23T13:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: NumberInput Field Not updated</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229859#M653</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/7207"&gt;@thomas_heller&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in fact this is reproducable. (when focusing on the field the set value disappears). Any&amp;nbsp; thoughts on how to go around that or what could be the reason for it?&lt;/P&gt;&lt;P&gt;Gil.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 13:18:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229859#M653</guid>
      <dc:creator>gilgi</dc:creator>
      <dc:date>2023-11-24T13:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: NumberInput Field Not updated</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229998#M654</link>
      <description>&lt;P&gt;This is a bug and the team is currently working on a fix. This is happening when you change the value of NumberField component programmatically.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way you can overcome this to use another component like TextInput and add custom validation logic to it.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2023 12:36:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/229998#M654</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-11-27T12:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: NumberInput Field Not updated</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/230167#M662</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/12008"&gt;@gilgi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I have some update from the team for you. The examples in our reference we have with the react-hook-form and useState hook have the same problem. And the way to go is, as also mentioned in the &lt;A href="https://react-hook-form.com/get-started#IntegratingwithUIlibraries" target="_blank"&gt;react hook form docs&lt;/A&gt;, to use Controllers.&lt;/P&gt;
&lt;P&gt;Here you have a &lt;A href="https://codesandbox.io/p/devbox/strato-text-number-input-forked-gwvxc6?file=%2Fsrc%2FApp.tsx%3A12%2C8-12%2C18" target="_blank"&gt;codebox sample with NumberInput field&lt;/A&gt;. That is the way you also need to adapt your code.&lt;/P&gt;
&lt;P&gt;Updating the code examples in our reference will take some time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 16:06:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/NumberInput-Field-Not-updated/m-p/230167#M662</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-11-28T16:06:40Z</dc:date>
    </item>
  </channel>
</rss>

