Repository navigation
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
web-padawan
left a comment
There was a problem hiding this comment.
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!
|
invalid state can be set
invalid state can be setinvalid state
DiegoCardoso
left a comment
There was a problem hiding this comment.
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 theinvalidproperty should be updated to the giveninvalidstate (by default: alwaystrue)._setInvalid(invalid)that updates theinvalidproperty to the giveninvalidstate if it passes_shouldSetInvalid. This method is supposed to be used by the web components wherever they need to updateinvalidinternally instead of manipulating the property directly.The main purpose of
_shouldSetInvalidis 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