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 unresponsive textarea from addon-event #6938

Merged
merged 2 commits into from
Jun 13, 2019

Conversation

lonyele
Copy link
Member

@lonyele lonyele commented Jun 2, 2019

Issue: Fixes #6936

What I did

Problem

From getDerivedStateFromProps, comparing some props and some state(always undefined) always initializes state which makes changing on textarea unresponsive.

Implementation

  • Assign payload value to prevPayload
  • Using lodash isEqual to properly compare changing props' payload and state's prevPayload

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps? No
  • Does this need an update to the documentation? No

If your answer is yes to any of these, please make sure to include it in your PR.

@vercel
Copy link

vercel bot commented Jun 2, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-fork-lonyele-fix-addon-event-textarea.storybook.now.sh

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

see comment

addons/events/src/components/Event.js Show resolved Hide resolved
@ndelangen
Copy link
Member

@lonyele I invited you to the github org. 👍

@ndelangen ndelangen modified the milestones: 5.1.0, 5.2.0, 5.1.x Jun 3, 2019
@lonyele
Copy link
Member Author

lonyele commented Jun 8, 2019

@shilman just ping for the comment. I'd like to migrate addon-event to typescript...

@ndelangen ndelangen modified the milestones: 5.1.x, 5.2.0 Jun 12, 2019
@lonyele
Copy link
Member Author

lonyele commented Jun 13, 2019

@ndelangen hm.. same goes here. Color is changed but it is not expected. I'll investigate this too

@ndelangen ndelangen merged commit 0c30750 into storybookjs:next Jun 13, 2019
@lonyele lonyele deleted the fix/addon-event-textarea branch July 19, 2019 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addon Events: can't edit payload
3 participants