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

fix: update types in 'field_input.ts' file #7514

Merged
merged 4 commits into from
Sep 22, 2023

Conversation

aku1310
Copy link
Contributor

@aku1310 aku1310 commented Sep 22, 2023

The basics

The details

Resolves

Fixes #7253

Proposed Changes

Update the field_input.ts file with the following changes:

Reason for Changes

Returning proper type info for input-specific manipulations of the element.

Test Coverage

Documentation

Additional Information

@aku1310 aku1310 requested a review from a team as a code owner September 22, 2023 17:44
@google-cla
Copy link

google-cla bot commented Sep 22, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome! It looks like this is your first pull request in Blockly, so here are a couple of tips:

  • You can find tips about contributing to Blockly and how to
    validate your changes on our
    developer site.

  • All contributors must sign the Google Contributor License
    Agreement (CLA). If the google-cla bot leaves a comment on this
    PR, make sure you follow the instructions.

  • We use conventional commits
    to make versioning the package easier. Make sure your commit
    message is in the proper format
    or learn how to fix it.

  • If any of the other checks on this PR fail, you can click on
    them to learn why. It might be that your change caused a test
    failure, or that you need to double-check the
    style guide.

Thank you for opening this PR! A member of the Blockly team will review it soon.

@aku1310
Copy link
Contributor Author

aku1310 commented Sep 22, 2023

I've signed the CLA after creating the PR. 😅

Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

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

Sorry about that! Looks like our issue instructions were slightly incorrect. I should have double checked.

Left comments below about what changes this needs! Thank you for all your work on this :D If it's still running into issues feel free to message me on slack!

@@ -358,7 +358,7 @@ export abstract class FieldInput<T extends InputTypes> extends Field<
throw new UnattachedFieldError();
}
WidgetDiv.show(this, block.RTL, this.widgetDispose_.bind(this));
this.htmlInput_ = this.widgetCreate_() as HTMLInputElement;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This cast is actually still necessary =) So if you could put it back that'd be great!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, will just do that!

@@ -375,7 +375,7 @@ export abstract class FieldInput<T extends InputTypes> extends Field<
*
* @returns The newly created text input editor.
*/
protected widgetCreate_(): HTMLElement {
protected widgetCreate_(): HTMLInputElement {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be HTMLInputElement | HTMLTextAreaElement

@BeksOmega BeksOmega assigned BeksOmega and unassigned maribethb Sep 22, 2023
@BeksOmega BeksOmega requested review from BeksOmega and removed request for maribethb September 22, 2023 20:07
Copy link
Collaborator

@BeksOmega BeksOmega left a comment

Choose a reason for hiding this comment

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

Thank you for all of your work on this @aku1310 :D

@BeksOmega BeksOmega merged commit 9051889 into google:osd Sep 22, 2023
7 checks passed
@fifi1120
Copy link

hey I am Fiona, glad to join the group! Could you pls assign me some tasks?

@maribethb maribethb changed the title minor: update 'field_input.ts' file fix: update types in 'field_input.ts' file Sep 26, 2023
@github-actions github-actions bot added the PR: fix Fixes a bug label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update widgetCreate_ in /core/field_input.ts to return HTMLInputElement instead of HTMLElement
4 participants