Skip to content

Commit

Permalink
fix: modal.prompt focus deply, close ant-design#1857
Browse files Browse the repository at this point in the history
  • Loading branch information
silentcloud authored and lixiaoyang1992 committed Apr 26, 2018
1 parent d00bc34 commit 6edbb1f
Showing 1 changed file with 41 additions and 35 deletions.
76 changes: 41 additions & 35 deletions components/modal/prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,27 @@ export default function prompt(
inputDom = (
<div className={`${prefixCls}-input-container`}>
<div className={`${prefixCls}-input`}>
<input
type="text"
value={data.text}
defaultValue={defaultValue}
ref={input => focusFn(input)}
onChange={onChange}
placeholder={placeholders[0]}
/>
<label>
<input
type="text"
value={data.text}
defaultValue={defaultValue}
ref={input => focusFn(input)}
onChange={onChange}
placeholder={placeholders[0]}
/>
</label>
</div>
<div className={`${prefixCls}-input`}>
<input
type="password"
value={data.password}
defaultValue=""
onChange={onChange}
placeholder={placeholders[1]}
/>
<label>
<input
type="password"
value={data.password}
defaultValue=""
onChange={onChange}
placeholder={placeholders[1]}
/>
</label>
</div>
</div>
);
Expand All @@ -65,14 +69,16 @@ export default function prompt(
inputDom = (
<div className={`${prefixCls}-input-container`}>
<div className={`${prefixCls}-input`}>
<input
type="password"
value={data.password}
defaultValue=""
ref={input => focusFn(input)}
onChange={onChange}
placeholder={placeholders[0]}
/>
<label>
<input
type="password"
value={data.password}
defaultValue=""
ref={input => focusFn(input)}
onChange={onChange}
placeholder={placeholders[0]}
/>
</label>
</div>
</div>
);
Expand All @@ -83,14 +89,16 @@ export default function prompt(
inputDom = (
<div className={`${prefixCls}-input-container`}>
<div className={`${prefixCls}-input`}>
<input
type="text"
value={data.text}
defaultValue={defaultValue}
ref={input => focusFn(input)}
onChange={onChange}
placeholder={placeholders[0]}
/>
<label>
<input
type="text"
value={data.text}
defaultValue={defaultValue}
ref={input => focusFn(input)}
onChange={onChange}
placeholder={placeholders[0]}
/>
</label>
</div>
</div>
);
Expand All @@ -99,10 +107,8 @@ export default function prompt(

let content = (
<div>
<label>
<span>{message}</span>
{inputDom}
</label>
{message}
{inputDom}
</div>
);

Expand Down

0 comments on commit 6edbb1f

Please sign in to comment.