修复 OfflineAccountSkinPane 中 cslApiField 的校验未生效的问题#5411
Hidden character warning
Conversation
|
什么˥ƆWH |
|
请不要在分支名内使用拉丁字母、数字、下划线和连字符以外的字符。 |
There was a problem hiding this comment.
Pull request overview
This PR aims to fix a validation issue in OfflineAccountSkinPane where the cslApiField validator was not being triggered. The changes enable real-time validation for the CSL API URL field and bind the accept button's disabled state to the validation result.
Changes:
- Import statements reorganized to group related imports together and alphabetize static imports
- Added
FXUtils.setValidateWhileTextChanged(cslApiField, true)to enable real-time validation - Added binding to disable the accept button when the cslApiField has validation errors
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cancelButton.setOnAction(e -> fireEvent(new DialogCloseEvent())); | ||
| onEscPressed(this, cancelButton::fire); | ||
|
|
||
| acceptButton.disableProperty().bind(cslApiField.activeValidatorProperty().isNotNull()); |
There was a problem hiding this comment.
The accept button is unconditionally bound to the cslApiField validator, which will disable the button even when the user selects skin types other than CUSTOM_SKIN_LOADER_API (e.g., DEFAULT, STEVE, ALEX, LOCAL_FILE, LITTLE_SKIN). This binding should be conditional - the button should only be disabled based on the validator when the selected skin type is CUSTOM_SKIN_LOADER_API. Consider using a conditional binding with Bindings.when() or Bindings.createBooleanBinding() that checks skinItem.selectedDataProperty() to ensure the validator only affects the button when CSL API is selected.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.