Skip to content

Conversation

@Stringer90
Copy link
Contributor

Added support for the MultilineTextInput widget for the web platform, which was missing. Relevant documentation has been updated.

This was tested using the examples/multilinetextinput app, as well as another small app to test color-related functions.

Currently, this widget on web does not resize vertically in response to flex or height styling, despite attempts to implement this.

Refs #3334

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@mhsmith mhsmith requested a review from freakboy3742 October 6, 2025 09:41
Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The multilinetext example app seems to work as expected, with the caveat about sizing that you flagged (I suspect that is at least partially due to #3391, so it's out of scope for fixing here).

I've merged this with main; we've just landed a very big change to Toga's documentation, and this PR got caught in the aftermath. I've also made a small change to the rehinting implementation, reflecting the approach taken on other backends.

This seems an odd approach, on two fronts:

  1. It's using a complicated mechanism to defer style changes
  2. It's using the shadowRoot, rather than the actual DOM object.

However, the one question I have about the implementation is the deferred "updateComplete" call on a number of features. It's not clear to me why it this required. It's also not clear why the style changes are being applied to the shadowDOM directly, not to the shoelace-level DOM. Can you elaborate on why these two approaches are needed?

@Stringer90
Copy link
Contributor Author

I just done some quicks tests to re-confirm things regarding your concerns, which involved setting style.resize to none. When applied to the Shoelace component, and not its inner textarea, the change doesn't take effect. When applied to the inner textarea outside of the _after_render (i.e. before it renders), the web app crashes (blank white UI).

The only combination that works is if the change is applied to the inner textarea, while also being deferred until after the Shoelace component renders. I have not yet tested every part yet, but I do remember it also not working with the color-related functions in a similar way.

@freakboy3742
Copy link
Member

The only combination that works is if the change is applied to the inner textarea, while also being deferred until after the Shoelace component renders. I have not yet tested every part yet, but I do remember it also not working with the color-related functions in a similar way.

Ok - from a quick poke around Shoelace's documentation the need for a deferred style update seems to make sense. A quick investigation about styles suggests you're likely right about needing to work on the shadow DOM as well.

What doesn't make sense, though, is why the deferred style thing hasn't come up before. It might be that this is the first widget that has "css altering methods" - but the base widget has a _reapply_style() method. It feels like there's a bigger problem at play here. Rather than re-implement the same pattern in multiple methods, I'd rather have a better understanding of what that problem is so that we can come up with a generic solution we can use everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants