-
Notifications
You must be signed in to change notification settings - Fork 83
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
refactor: add methods to make setting invalid overridable #4097
Conversation
4facd4e
to
6118dde
Compare
44d3a1a
to
47a9219
Compare
If I understood it correctly, it should be the other way around. The Flow counterpart should allow the web component to set |
Ah, you are right 👍 . It is just a typo by the way. I corrected the description. |
6118dde
to
b087222
Compare
b41eb21
to
7a71d4c
Compare
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.
Would it make sense to simplify method names e.g. _shouldSetInvalid()
and _setInvalid()
to better describe what they do?
My concern at the beginning was that this naming might be confusing especially when you override So I agree to use more straightforward naming. 👍 This way it will be in line with |
55a477a
to
243acbf
Compare
243acbf
to
5c55014
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
invalid
state can be set
invalid
state can be setinvalid
state
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.
I have noticed that ErrorController
implements setInvalid
, but didn't check if it might affect the new behavior. Could you double check it?
The new method is actually in the |
Ah, right. I wasn't fully aware of the difference between mixins and controllers. Got it now, thanks. |
invalid
state
Description
_shouldSetInvalid(invalid)
that determines whether theinvalid
property should be updated to the giveninvalid
state (by default: alwaystrue
)._setInvalid(invalid)
that updates theinvalid
property to the giveninvalid
state if it passes_shouldSetInvalid
. This method is supposed to be used by the web components wherever they need to updateinvalid
internally instead of manipulating the property directly.The main purpose of
_shouldSetInvalid
is to make it possible later for Flow to prevent the web components from committing client-side validation success: the final decision on whether a component is valid will be made by the server.Part of #4081
Type of change
Checklist