Value does not display when setting format of a number type common field

Hi,
When I set the format via JS of a number common field the display of the value disappears from the form. When I click in the field the value becomes visible and when I click out it becomes formatted well. However, I do not want to click in the field and then click out of it. I would like the value to be reformatted without further user interaction.

fd.field("Number").value = 500;
const currency = "USD";
fd.field("Number").widgetOptions = {
      format: `0 ${currency}`,
    };

This code sets the value of the "Number" field to 500, but nothing is shown in the field in the form. It is empty. Unless, of course, I manually interact with it.
Please help.
Thank you

Hi @Janos_Nagy,

I couldn't reproduce the issue so far. Are there any errors in the browser's console? Could you share all of the form's code?

Thanks for looking into this. I have the "Title" SharePoint field on the form and a "Number" common field of number type. The code is this:

fd.spRendered(function () {
  fd.field("Title").$on("change", function (string) {
    fd.field("Number").widgetOptions = {
      format: `0 ${string}`,
    };
  });
});

When the form loads I enter a number (e.g.: 7) into the "Number" field.
It shows 7.
Then I enter a string, like "USD" into the "Title" field.
The "Number" field shows nothing.
Then I click inside the "Number" field.
It shows 7.
I click outside the "Number" field.
It shows "7 USD".

This is on SharePoint 2019 on-premise and I have the latest Plumsail froms installed.

Hi @Janos_Nagy,

I'm still unable to reproduce this problem. Could you share a screen capture video? You can send it to support@plumsail.com if it's not okay to share it publicly.

Are there any errors in the browser's console (F12)?

I made this video:

This is in the browser console:

Hi @Janos_Nagy,

Which version of the app are you using? Is it an SP Online or SP SE solution?

Could you also check the widget version of the form? For this open developer tools (F12) >> source >> page >> forms.plumsail.com:

@IliaLazarevskii
I use SharePoint on-premise 2019.
Widget version I cannot find. Here is what I can see:

@IliaLazarevskii
Any update?

Hi @Janos_Nagy,

I apologize for the late response. Could you share a form export and a HAR file of the issue?

Hi @IliaLazarevskii ,
I have sent the files to the support address.

Hi @Janos_Nagy,

I'm reposting the suggestion I offered via email here in case someone else finds it helpful.

The custom format isn’t applied to the field when the user is interacting with it, so in order to display the formatting correctly we need to make the field lose focus:

fd.spRendered(() => {
    fd.field('Title').$on('change', v => {
        fd.field('Number').widgetOptions = {
            format: `0 ${v}`
        }
        
        fd._vue.$nextTick().then(() => {
            fd.field('Number').widget._blur();
        });
    });
});

I confirm that this works. Thank you for the help.