-
I'm taking a poke at playing with layers, with the goal of being able to overlay an input widget with an a second input widget, and then remove the second revealing the first still intact. In a modified version of the layers example:
and layers.css:
When I run the program and hit T, box1 overlays box2 correctly. When I toggle again, box1 is removed from the DOM, but is still present on the screen. If I sweep the mouse back and forth across box1, it will disappear and box2 reappears. I guess I'm triggering a screen update by swiping the mouse across the now removed widget? I also attempted this same idea using the the visibility attribute of the higher-layer widget rather than removing it completely, and it suffered from the same lack of an update. How can I cause that update programmatically? Or am I just going about this the wrong way? Thanks for any advice! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Could you confirm what version of Textual you're doing this with? (the output of I've just tested with 0.14.0 and it seemed to work just as you expected, but with v0.15.1 it doesn't seem to be behaving at all. As such, I'm going to create an issue from this discussion as I feel it needs looking into a bit further as a potential bug. |
Beta Was this translation helpful? Give feedback.
-
Another thing to note is if you give the lower layer box an offset (I just tried 1 1), it behaves as it should, but if you give the upper box an offset instead, it doesn't update. |
Beta Was this translation helpful? Give feedback.
-
For those reading later, I copied and pasted the example from the first post here and it works as intended. |
Beta Was this translation helpful? Give feedback.
Could you confirm what version of Textual you're doing this with? (the output of
textual diagnose
would be helpful).I've just tested with 0.14.0 and it seemed to work just as you expected, but with v0.15.1 it doesn't seem to be behaving at all. As such, I'm going to create an issue from this discussion as I feel it needs looking into a bit further as a potential bug.