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

Add <EditableTextLabel> #43

Merged
merged 13 commits into from
May 24, 2017
Merged

Conversation

zhusee2
Copy link
Contributor

@zhusee2 zhusee2 commented May 19, 2017

Purpose

Add <EditableTextLabel> which can go into edit mode by turning on inEdit prop.
It also calls onEditRequest callback when double-clicked on desktop browsers, so you know when to set the inEdit prop.

Implement

  1. <EditableText> now takes an onEditEnd callback, and will call that on:

    • <Input> blur. (call as save)
    • Enter key . (call as save)
    • Esc key. (call as reset/cancel)
  2. Add <EditableTextLabel> to be used when you know this text label should carry editing logics. If you're sure a text label is not supposed to be edited, use <TextLabel>.

Demo

editable

@zhusee2 zhusee2 requested a review from cjies May 19, 2017 04:48
@zhusee2 zhusee2 force-pushed the feature/zhusee_editable_text_label branch 2 times, most recently from 92a6152 to eb80f15 Compare May 19, 2017 09:21
value: event.target.value,
});
this.setState(
{ lastNotified: Date.now() },
Copy link
Contributor

@cjies cjies May 23, 2017

Choose a reason for hiding this comment

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

why not use currentTimestamp as value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because I forgot to XD

@zhusee2 zhusee2 force-pushed the feature/zhusee_editable_text_label branch from ac40c02 to 809c406 Compare May 23, 2017 09:44
@zhusee2
Copy link
Contributor Author

zhusee2 commented May 23, 2017

Fixed and rebased with latest develop

@zhusee2 zhusee2 force-pushed the feature/zhusee_editable_text_label branch from 809c406 to 88ff438 Compare May 23, 2017 10:17
@zhusee2 zhusee2 merged commit bf19454 into develop May 24, 2017
@zhusee2 zhusee2 deleted the feature/zhusee_editable_text_label branch May 24, 2017 06:13
This was referenced May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants