Slider with Text Box focus issue

I have a slider and text box that are reading/writing to the same tag. If I click in the text box and then click on the slider to manipulate the tag value, the text box doesn’t update until I’ve clicked on something that takes to focus away from the text box.

How can I make it so when I click on the slider that I remove focus from the text box so that it updates properly?

I’ve tried to make the slider request focus when it is clicked, but that doesn’t seem to remove the focus from the text box.

You need to uncheck “reject updates during edit”

Allowing updates during edit should let your slider work, but may or may not be desirable if the number can be changed by someone/something else at the same time. As an alternative, you should be able to remove focus from the text box as you initially attempted. As an example, we clear focus from all input fields when mouse exits them with this code in the mouseExited event of the input component (Text Field in picture below):

# Lose focus on mouse exit to avoid accidental entry when mouse is somewhere else.

This code is based on the input field being in a template with input field border hidden and a rectangle around it called frame as below, but you can adapt it to put the focus wherever you want it when mouse leaves input field.

This does what we need for now. I wish the focus on this component in particular was more intuitive for stuff like this. Oh well.