Iris icon indicating copy to clipboard operation
Iris copied to clipboard

Immutable inputs

Open ari-party opened this issue 11 months ago • 7 comments

Would be a great enhancement to 'disable' an input, e.g. to preview data.

ari-party avatar Jan 19 '25 16:01 ari-party

Seems like a useful addition. I can have a look at how Dear ImGui does it.

SirMallard avatar Jan 19 '25 16:01 SirMallard

Temporary solution is to create a seperate state, and updating the input's state to it whenever numberChanged() is true.

ari-party avatar Jan 19 '25 16:01 ari-party

I attempted something like this previously, with a disabled property which would prevent updates from happening. However, due to the way that Iris updates, with Instance events happening out of order, it's a bit difficult to prevent a widget from updating properly.

Would you like this to prevent the user from interacting with a widget, but allow updates to happen, or a full 'freeze' of widgets that prevents any state changes?

SirMallard avatar Mar 11 '25 13:03 SirMallard

@SirMallard The use case I wanted this for was displaying data, so 'freezing' widgets would work for this.

ari-party avatar Mar 11 '25 14:03 ari-party

I don't think I was clear here.

By freezing, I mean it will not update when the state object behind it changes, ie. if there's a state object which controls it and you update the state object, it won't change the widget visually.

And by interaction, I mean that they can't drag or press the widget to update it, but the state objects can still make changes, allowing you to just 'display' values, without the user's mouse or keyboard changing the values.

SirMallard avatar Mar 13 '25 10:03 SirMallard

@SirMallard Oops

And by interaction, I mean that they can't drag or press the widget to update it, but the state objects can still make changes, allowing you to just 'display' values, without the user's mouse or keyboard changing the values.

This is what I meant.

ari-party avatar Mar 13 '25 10:03 ari-party

This is really tricky to do, beacuse widget interaction happens in multiple places across the frame. This means it is quite difficult to know whether a widget is immutable and then also how to prevent any changes from happening. In certain situations, the UI of a widget is updated before the state value is set, making it difficult to find where all the changes happen. I want to get this working, it is just quite difficult to find a nice solution without needing tonnes of checks.

SirMallard avatar Jul 15 '25 12:07 SirMallard