Force rerender for a custom modal

I am customizing the apply redactions process.

When the user clicks the button to apply redactions, I’m opening a custom modal where I need to take and validate some user input.

I’m hitting a problem where after validating the user input and adding an invalid class to the input element, the input is not displaying the css of the class that was added to the element, despite the dom telling me that the class exists on the element. I’ve determined that it’s because my custom modal needs to rerender in order to display the updated state of the input. How can I go about achieving this behavior?

Would you be able to share your code for your custom modal? And also describe how you open the modal in WebViewer