-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add custom errorLabel to MaterialTextField #1901
Conversation
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.
NACK
If the help text is used and the validation triggers an error the error is displayed above the help.
The // TODO add custom errorLabel...
can be removed.
At onWidthChanged
the errorLabel.setPrefWidth(width - 2 * errorLabel.getLayoutX());
is missing
Best to check the reformat
checkbox at the commit interface in IntelliJ so that code is correctly formatted (just a missing space where you add the errorLabel)
In preferences the min required reputation use a help field and can be used for testing.
@HenrikJannsen I have made the required changes. It was best to set the help to invisible when there is an error message and visible when no error. Other option was making help empty but that made the components below move up so that was not a good option. |
Does the error message replace the help text? So if the error message gets cleared the help text is back? |
Yes. When error is cleared help message is back |
any other thing I need to do here? Is this good for merge? |
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.
NACK
apps/desktop/desktop/src/main/java/bisq/desktop/components/controls/MaterialTextField.java
Outdated
Show resolved
Hide resolved
@HenrikJannsen updated the code |
I am busy atm. Will review a bit later. Anyone else can review as well. |
ok |
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.
NACK
This is not the appropriate change to make the component generic. We do not want to adjust the outside container but the height calculation should take care of the potential existence of the error or help field. With the error field getting visible the height should gets updated so that the outside container re-layouts and maintains the intended spacing.
I will not review personally more PR's as my time would be better spent by fixing it myself. Any other contributor though is welcome to review upcoming PRs. Just wanted to give you my feedback so that you can manage expectations.
Noted @HenrikJannsen |
@HenrikJannsen I know you have been very patient with me and this PR in taking the time to look at it as you have other pressing issues to look at. Only now do I see what you mean by height calculation should take of the error text showing. Should have seen this earlier (my bad) last commit
if you have not fixed this already and theres a 1% chance of taking a look at this, it will be great as I am now getting familiar with the code base. |
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.
NACK
The following comment is not addressed with the latest changes. Help text is not getting back:
Does the error message replace the help text? So if the error message gets cleared the help text is back?
apps/desktop/desktop/src/main/java/bisq/desktop/components/controls/MaterialTextField.java
Outdated
Show resolved
Hide resolved
Hi @axpoems help text does come back for places that had help text. Not all fields have help text except if there is another part of the app I am not seeing this |
@axpoems This is what I have. And I have pushed this see video: |
the field cannot be left empty as empty is also an error. it has to be a number placed in there. At least that was how it worked before |
I have enabled reformat code now. |
@ItoroD Is the PR ready for review?
E.g. In case the PR is not ready for review (e.g. under dev) please convert it to a draft PR. |
@djing-chan yes it is ready for review. I was hoping anyone or @axpoems will retest has he made a mistake in testing. Appropriate value should be put in field before error clears for help text to come back. Height changes now when error shows |
@ItoroD When the error message is not visible the overall height of the component should be adopted to the height needed. |
@djing-chan short.mp4 |
Looks ok now from the video. |
rebase done. |
Squashing all commits on top of the rebase would be good. You can select your commits in IntelliJ in the Github commit history and squash them. Then run a rebase on main. |
resize of component when error is shown. Also bring back helptext when error disappears changed helpLabel code to errorLabel code for error validation made helplabel invisible when error label shows removed commented code. Setting errorlabel to help is unecessary changed spacing of vbox to accomodate error message removed setopacity and used setmanage instead. Made height to be calculated automatically for error text removed unecessary commented code enabled reformat code added code to make height go back to original position after resize Check that error style does not exist before you set error style
198508b
to
e519935
Compare
this better? @djing-chan |
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.
Add custom errorLabel to MaterialTextField (rebase of #1901)
I replaced helpLabel with error label where necessary. Tested validation and it works correctly. This should avoid any bind errors
@HenrikJannsen