adobe-photoshop / spaces-design

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

Add acquireFocusOnMouseDown prop to Focusable, set to false in LayerFace #3657

Closed baaygun closed 8 years ago

baaygun commented 8 years ago

When the name of the layer in a LayerFace was clicked on, we would immediately call OS.acquireKeyboardFocus due to the mousedown listener in Focusable mixin (which is the mixin of TextInput showing layer name). But we would never call OS.releaseKeyboardFocus because those were only called on commit/cancel/finish methods.

For TextInputs like layer name, we don't want to acquire focus unless the user double clicks to start editing. We instead acquire focus on _beginEdit function which is what happens when user double clicks.

Addresses #3581

iwehrman commented 8 years ago

Do we need to explicitly call acquireFocus once the TextInput becomes editable?

baaygun commented 8 years ago

No @iwehrman, _beginEdit calls acquireFocus. It is called by both click, focus and doubleclick based on different scenarios.

iwehrman commented 8 years ago

Roger. In that case: looks good!