Skip to content

Commit eee19e6

Browse files
fix(ui): replace duplicate error-msg IDs with form-error-text class
1 parent ef9f688 commit eee19e6

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/edit_python_pe/components/form_control.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ def compose(self) -> ComposeResult:
2626
if self.help_text_content:
2727
yield Static(self.help_text_content, classes="form-help-text")
2828

29-
yield Static("", classes="form-error-text", id="error-msg")
29+
yield Static("", classes="form-error-text")
3030

3131
def on_mount(self) -> None:
32-
self.query_one("#error-msg", Static).display = False
32+
self.query_one(".form-error-text", Static).display = False
3333

3434
def show_error(self, message: str) -> None:
35-
error_static = self.query_one("#error-msg", Static)
35+
error_static = self.query_one(".form-error-text", Static)
3636
error_static.update(message)
3737
error_static.display = True
3838

3939
# Apply has-error class to self
4040
self.add_class("has-error")
4141

4242
def clear_error(self) -> None:
43-
error_static = self.query_one("#error-msg", Static)
43+
error_static = self.query_one(".form-error-text", Static)
4444
error_static.update("")
4545
error_static.display = False
4646

tests/unit/components/test_form_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def test_form_control_logic(self):
2222
assert fc.help_text_content == "Test Help"
2323

2424
# Error states
25-
error_msg = fc.query_one("#error-msg", Static)
25+
error_msg = fc.query_one(".form-error-text", Static)
2626
assert error_msg.display is False
2727

2828
fc.show_error("Bad input")

0 commit comments

Comments
 (0)