-
-
Notifications
You must be signed in to change notification settings - Fork 882
Add prefix and suffix to ui.input, and enable ui.number to support dy… #5534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,6 +115,22 @@ def sanitize(self) -> None: | |
| value = float(round(value, self.precision)) | ||
| self.value = float(self.format % value) if self.format else value | ||
| self.update() | ||
|
|
||
| def set_prefix(self, text: Optional[str]) -> None: | ||
| """ | ||
| Set the prefix. | ||
| :param text: the context of the prefix. | ||
| """ | ||
| self._props['prefix'] = text | ||
|
|
||
| def set_suffix(self, text: Optional[str]) -> None: | ||
| """ | ||
| set the suffix. | ||
Yuerchu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| :param text: the context of the suffix. | ||
Yuerchu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Yuerchu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
| self._props['suffix'] = text | ||
|
Comment on lines
119
to
133
|
||
|
|
||
| def _event_args_to_value(self, e: GenericEventArguments) -> Any: | ||
| if not e.args: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
prefixandsuffixparameters forui.inputlack test coverage. Consider adding tests that verify:set_prefixandset_suffixmethods work correctlyGiven that other similar parameters in
test_input.pyhave comprehensive test coverage, this feature should have tests as well.