When clearing the content of a fieldCOMP with a script, I assume the only way of doing that would be to clear the ‘string’ table inside, the info ‘cursor_start’ and ‘cursor_end’ stays at the last value.
I have to operate on the fieldCOMP in order to let these values update.
thanks for pointing this out. Wonder if cursor related values should be cleared when loosing focus.
Also can you describe how you are using these? Would be good to also have these values available in the Text Panel COMP.
I was using the expression tdu.clamp(op(‘text1’).cursorStart) to control the opacity of the second textTOP. So when the field would be empty, the cursor would be set to ‘0’, so will the opacity. As soon as the user starts typing, the cursor switches to 1 and further, so the opacity stays at 1 (due to the clamping).
I eventually solved it with using the ‘textHeight’. I was using the ‘textWidth’ before, but that gave me situations where the entire fieldCOMP got locked, which I’m currently not able to replicate.
we’ve added a feature to the Text Panel COMP where you can specify a Placeholder Text via parameters on the “Text” page. Together with the Text Panel COMP’s callbacks, you might not need to watch any info channels. Would this simplify things for you?
The textCOMP wasn’t an option for me. Not sure if it’s a bug, but when using the ‘Focus Order’ icm with a set of textCOMPs, as soon as 1 of the textCOMPs type is set to ‘multi line’, the tab key will not switch to the next textCOMP but instead starts indenting the text inside the multiline textCOMP.
So I was bound to the fieldCOMP, which keeps switching to the next fieldCOMP, regardless if it’s set to ‘allow multiline’ or not.