JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="valor" />

JavaScript

$("#valor").on("change", function()
{
    var num = Number(this.value.replace(",", "."));
    
    if (isNaN(num))
    {
        this.value = "";
    }
    else
    {
    	this.value = num.toFixed(1).replace(".", ",");
    }
});