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

Create <TextInput> row component #41

Merged
merged 4 commits into from
May 18, 2017
Merged

Conversation

zhusee2
Copy link
Contributor

@zhusee2 zhusee2 commented May 17, 2017

Purpose

Create <TextInput> which renders the pre-configured <EditableText> instead of basic <Text> generated by rowComp() mixin.

Implement

  1. Add <TextInput> which renders and pass whitelisted props to an <EditableText> inside.
  2. Add getTextLayoutProps() helper in rowComp() so components can have the same text layout logic as a regular rowComp() component.
  3. Add tests for <TextInput>.

Demo

2017-05-17 3 41 16

@zhusee2 zhusee2 requested a review from cjies May 17, 2017 07:50
</DebugBox>

<DebugBox>
<TextInput value="Controlled input" />
Copy link
Contributor

Choose a reason for hiding this comment

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

controlled input should contain onChange in example ? XD


<DebugBox>
<TextInput
value="Kitchen Printer"
Copy link
Contributor

Choose a reason for hiding this comment

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

Here also.

主要是避免 console 會噴奇怪的 warning XD

Copy link
Contributor

@cjies cjies left a comment

Choose a reason for hiding this comment

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

Others LGTM

@zhusee2
Copy link
Contributor Author

zhusee2 commented May 18, 2017

這邊的問題是: <EditableText> 裡面的 <input> 一直都是 controlled input XD

為了讓 <EditableText> 可以用比較簡單的方式讀取 input value、並配合更新 basic label
裡面的 <input> value 是經由 state 控制的。
所以是透過 <EditableText> 本身的實作去保留 controlled / uncontrolled input 的特性

@zhusee2
Copy link
Contributor Author

zhusee2 commented May 18, 2017

不過我還是補一下
因為 onChange 是預期應該要加的 prop

@zhusee2 zhusee2 merged commit 782182f into develop May 18, 2017
@zhusee2 zhusee2 deleted the feature/zhusee_text_input branch May 18, 2017 09:58
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.

None yet

2 participants