Skip to content
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

Added Sending the Bad Value to doValueInvalid #2577

Merged
merged 2 commits into from
Jun 24, 2019

Conversation

BeksOmega
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

N/A

Proposed Changes

doValueInvalid_() now recieves the invalid value.

Reason for Changes

Makes it easier for fields to display invalid values if they wish.

This was not added previously because the only core field that uses doValueInvalid is the text input field, and its display value is stored on the htmlInput. But when I was working on the custom fields demo I found that this was useful.

Test Coverage

N/A

Additional Information

N/A

@RoboErikG RoboErikG requested review from rachel-fenichel and alschmiedt and removed request for rachel-fenichel June 21, 2019 20:37
Copy link
Contributor

@alschmiedt alschmiedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

* @protected
*/
Blockly.FieldTextInput.prototype.doValueInvalid_ = function() {
Blockly.FieldTextInput.prototype.doValueInvalid_ = function(_newValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this underscore signify? I'm not familiar with such a naming scheme.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that it's just a thing for the eslint, so that it doesn't freak out about an unused variable.

* @protected
*/
Blockly.FieldTextInput.prototype.doValueInvalid_ = function() {
Blockly.FieldTextInput.prototype.doValueInvalid_ = function(_newValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually thinking about this could you change _newValue to something like _invalidValue? I think it is a bit more clear. sorry for the late comment!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Can do =)

@alschmiedt alschmiedt merged commit 55fc506 into google:develop Jun 24, 2019
@BeksOmega BeksOmega deleted the fixes/doValueInvalid branch July 1, 2019 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants