Skip to content
This repository was archived by the owner on Oct 23, 2020. It is now read-only.

submit questions on paste#13

Open
whsu00 wants to merge 3 commits into
Cal-CS-61A-Staff:masterfrom
whsu00:submit-on-paste
Open

submit questions on paste#13
whsu00 wants to merge 3 commits into
Cal-CS-61A-Staff:masterfrom
whsu00:submit-on-paste

Conversation

@whsu00

@whsu00 whsu00 commented Sep 23, 2020

Copy link
Copy Markdown

No description provided.

Comment thread apps/js/Question.js Outdated
onChange={(e) => {
setValue(e.target.value);
}}
onPaste={submit}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This may not work, because the value state would not have updated in the submit closure. You want to write a handlePaste that calls submitValue with the pasted value.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

oh how I've missed the javascript event loop..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants