Merge branch 'main' into fix-1616

This commit is contained in:
Will McGugan
2023-01-25 11:52:29 +01:00
committed by GitHub
5 changed files with 15 additions and 19 deletions

View File

@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed stuck screen https://github.com/Textualize/textual/issues/1632
- Fixed relative units in `grid-rows` and `grid-columns` being computed with respect to the wrong dimension https://github.com/Textualize/textual/issues/1406
- Programmatically setting `overflow_x`/`overflow_y` refreshes the layout correctly https://github.com/Textualize/textual/issues/1616
- Fixed double-paste into `Input` https://github.com/Textualize/textual/issues/1657
## [0.10.1] - 2023-01-20

View File

@@ -64,21 +64,6 @@ or by clicking on it.
| `item` | `ListItem` | The item that was selected. |
### ChildrenUpdated
The `ListView.ChildrenUpdated` message is emitted when the elements in the `ListView`
are changed (e.g. a child is added, or the list is cleared).
- [x] Bubbles
#### Attributes
| attribute | type | purpose |
| ---------- | ---------------- | ------------------------- |
| `children` | `list[ListItem]` | The new ListView children |
## See Also
* [ListView](../api/list_view.md) code reference

View File

@@ -1095,8 +1095,12 @@ class App(Generic[ReturnType], DOMNode):
Args:
*widgets: The widget(s) to mount.
before: Optional location to mount before.
after: Optional location to mount after.
before: Optional location to mount before. An `int` is the index
of the child to mount before, a `str` is a `query_one` query to
find the widget to mount before.
after: Optional location to mount after. An `int` is the index
of the child to mount after, a `str` is a `query_one` query to
find the widget to mount after.
Returns:
An awaitable object that waits for widgets to be mounted.
@@ -1120,8 +1124,12 @@ class App(Generic[ReturnType], DOMNode):
Args:
widgets: An iterable of widgets.
before: Optional location to mount before.
after: Optional location to mount after.
before: Optional location to mount before. An `int` is the index
of the child to mount before, a `str` is a `query_one` query to
find the widget to mount before.
after: Optional location to mount after. An `int` is the index
of the child to mount after, a `str` is a `query_one` query to
find the widget to mount after.
Returns:
An awaitable object that waits for widgets to be mounted.

View File

@@ -256,6 +256,7 @@ class Input(Widget, can_focus=True):
def on_paste(self, event: events.Paste) -> None:
line = event.text.splitlines()[0]
self.insert_text_at_cursor(line)
event.stop()
def on_click(self, event: events.Click) -> None:
offset = event.get_content_offset(self)

View File

@@ -48,6 +48,7 @@ async def test_input_value_visible_if_mounted_later():
app = MyApp()
async with app.run_test() as pilot:
await pilot.press("a")
await pilot.pause()
console = Console(width=5)
with console.capture() as capture:
console.print(app.query_one(Input).render())