Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix(toutiao): 修正 Input 属性默认值 (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pochodaydayup committed May 15, 2020
1 parent 42d5d4d commit b0bd005
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

exports[`Input render correctly 1`] = `
<input
cursor={-1}
cursorSpacing={0}
maxlength={140}
selectionEnd={-1}
selectionStart={-1}
type="text"
value=""
/>
Expand Down
13 changes: 12 additions & 1 deletion packages/remax-toutiao/src/hostComponents/Input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@ export interface InputProps extends BaseProps {
onConfirm?: () => void;
}

export default createHostComponent<InputProps>('input');
const Input = createHostComponent<InputProps>('input');

Input.defaultProps = {
type: 'text',
maxlength: 140,
selectionEnd: -1,
selectionStart: -1,
cursorSpacing: 0,
cursor: -1,
};

export default Input;

1 comment on commit b0bd005

@vercel
Copy link

@vercel vercel bot commented on b0bd005 May 15, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.