-
-
Notifications
You must be signed in to change notification settings - Fork 919
Fix valid_empty #5909
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?
Fix valid_empty #5909
Conversation
Fixes #5917. Now ready for review. Apologies for the whitespace amendments - I'll try to avoid this in future. |
Sorry if this has already been discussed over on Discord, but I'm just concerned about the impact of this change. Currently My concern is that the impact of this change will be more surprising than the problem it intended to solve. This would mean all Inputs created with just the defaults are suddenly going to be invalid when empty and display the red border. |
I see your point about the change of behaviour, but would argue that this should be seen as the textual equivalent of the ubiquitous web red asterisk to indicate a required field. I also feel this change would introduce a consistency that is currently lacking: it makes little sense to me that the test added in the first commit should fail. I don't really understand "Currently valid_empty is only intended for any input validators;" it seems I completely missed the implication, and since explicit is in any case preferable to implicit this would imply at least the need for a docs change. Nor do I appear to understand what use validators are supposed to make of the valid_empty flag, or quite whose benefit it is intended for. The fact that just one single test broke, and only in a non-functional way, surely implies some measure of safety for this. Alternatively, can this change be tabled for a 4.0 revision as a breaking change, in which valid_empty is replaced by a |
@willmcgugan I wonder if you have anything to add here? |
Why don't you consider this a breaking change? Currently an |
I believe I understand your objections, but would suggest that the current behaviour is a bug rather than a feature, essentially allowing something specifically tagged as |
Id just like to document here that this was indeed discussed on the Discord a couple weeks ago, Will saw it and said this:
https://discord.com/channels/1026214085173461072/1033754296224841768/1387112695169417247 |
Sorry I haven't kept up. Bit distracted atm. You know, I don't think this is desirable behavior either. If But the converse isn't true. If |
Yeah that makes perfect sense. |
Please review the following checklist.
This fixes a problem where an
Input
withvalid_empty=False
validates successfully in the absence of any validators.At present the correct handling of this condition breaks one existing test:
test_focus_within_transparent
fails because the Input box on the left is no longer incorrectly validated, and so has a red outline that was previously absent. I'd like to discuss how best to proceed.