Skip to content

Commit

Permalink
Merge branch 'main' into key-modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns authored Aug 12, 2024
2 parents 473afcd + 3de42a9 commit 635869a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Change to how keys with modifiers are reported. When shift + another modifier is pressed, then the key name will contain "shift", and the key will be *lower case*. i.e. `ctrl+shift+E` and not `ctrl+E` https://github.com/Textualize/textual/pull/4861

### Fixed

- Fix crash when `validate_on` value isn't a set https://github.com/Textualize/textual/pull/4868

## [0.76.0]

### Changed
Expand Down
4 changes: 2 additions & 2 deletions src/textual/widgets/_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import re
from dataclasses import dataclass
from typing import TYPE_CHECKING, ClassVar, Iterable, cast
from typing import TYPE_CHECKING, ClassVar, Iterable

from rich.cells import cell_len, get_character_cell_size
from rich.console import Console, ConsoleOptions, RenderableType
Expand Down Expand Up @@ -301,7 +301,7 @@ def __init__(
self.validators = list(validators)

self.validate_on: set[str] = (
(_POSSIBLE_VALIDATE_ON_VALUES & cast("set[str]", validate_on))
(_POSSIBLE_VALIDATE_ON_VALUES & set(validate_on))
if validate_on is not None
else _POSSIBLE_VALIDATE_ON_VALUES
)
Expand Down
7 changes: 4 additions & 3 deletions tests/input/test_input_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ async def test_on_blur_triggers_validation():
"validate_on",
[
set(),
[],
{"blur"},
{"submitted"},
{"blur", "submitted"},
{"fried", "garbage"},
["submitted"],
["blur", "submitted"],
["fried", "garbage"],
],
)
async def test_validation_on_changed_should_not_happen(validate_on):
Expand Down

0 comments on commit 635869a

Please sign in to comment.