adobe-photoshop / spaces-design

Adobe Photoshop Design Space
http://adobe-photoshop.github.io/
Other
851 stars 74 forks source link

TextInput and Datalist event handling fixes #3714

Closed iwehrman closed 8 years ago

iwehrman commented 8 years ago

This PR makes the following changes to the event-handling interfaces of TextInput and Datalist:

  1. TextInput now has a single onInput prop in place of the previous onInputChange and onDOMChange props. Those props were only ever being called one after another as a result of a change event on the input element, so this simplifies the interface and changes the name to be more meaningful and correct.
  2. Datalist now has an onInput prop that replaces the previous onInputChange prop. The latter was a confusing name in relation to the semantics of that prop, which was and is that it is triggered as a result of the child TextInput's onInput event.

Besides updating the usage of these components and fixing up some stale comments, this also makes a change to the shouldComponentUpdate method of Dialog. On master, it never re-renders while the dialog is open, which means that the contents of the dialog don't ever re-render as a result of a parent re-render. Consequently, the Select component of Datalist was not correctly filtering during input. This changes the shouldComponentUpdate method to always re-render when the Dialog is open.

Addresses #3713.

iwehrman commented 8 years ago

Unassigning @DivyaPrabhakar since she's busy at the moment and anybody else can review this. Of course, if @DivyaPrabhakar frees up, she can still do the review!

baaygun commented 8 years ago

LGTM