https://mobile.ant.design/components/modal-cn/, "promise" and "defaultValue" cases
antd-mobile version: 2.1.4
When call Modal.prompt() which type is "default"
ref #2177
@handsomeceleste What do you mean about cannot input anything? maybe same as #2177 ?
Hello @handsomeceleste. Please provide a re-producible demo: https://codepen.io/pen?template=LWpaKe&editors=0010
@paranoidjk I have test the "Modal.prompt()" demo under my MAC browser (Safari & Chrome), but I cannot input anything by keyboard, the value of input widget always be the last character what I inputed.
However, Under Windows, It works well, I'm not sure whether the problem is the "cursor focus" you mentioned before or not.
hi, guys, I met the same problem as yours, which I can't input more than two characters to Modal.promt ,and none of inputed characters were shown in the input zone.
Win10 ,chrome version: 63.0.3239.84 x64
"dependencies": {
"antd-mobile": "^2.1.4",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts-ts": "2.13.0"
},
For a minimal reproduce case at CodePen :
const { Tabs, WhiteSpace, Badge, Modal, Button} = window["antd-mobile"];
const TabExample = () => (
<div>
<WhiteSpace />
<Button onClick={() => Modal.prompt('้กต้ข่ทณ่ฝฌ', '',[{text: 'Cancel'},
{text: 'Submit',
onPress: (value: any) => new Promise((resolve) => {
console.log(`jump:${value}`);
resolve();
}),
},
], 'default', '', ['่ฆๅปๅชไธ้กตๅข'])}>Go</Button>
</div>
);
ReactDOM.render(<TabExample />, mountNode);
And this is the local package dependencies, seems no differences with 2.1.3 :
โโ [email protected]
โ โโ array-tree-filter@~2.0.0
โ โโ [email protected]
โ โโ classnames@^2.2.1
โ โโ normalize.css@^7.0.0
โ โโ rc-checkbox@~2.0.0
โ โโ rc-collapse@~1.7.0
โ โโ rc-drawer@~0.4.9
โ โโ rc-slider@~8.2.0
โ โโ rc-swipeout@~2.0.0
โ โโ rmc-calendar@^1.0.0
โ โโ rmc-cascader@~5.0.0
โ โโ rmc-date-picker@~6.0.0
โ โโ rmc-dialog@^1.0.1
โ โโ rmc-feedback@^1.0.0
โ โโ rmc-input-number@^1.0.0
โ โโ rmc-list-view@^0.11.0
โ โโ rmc-notification@~1.0.0
โ โโ rmc-nuka-carousel@~3.0.0
โ โโ rmc-picker@~5.0.0
โ โโ rmc-pull-to-refresh@~1.0.1
โ โโ rmc-steps@~1.0.0
โ โโ rmc-tabs@~1.2.0
โ โโ rmc-tooltip@~1.0.0
โ โโ rn-topview@^0.1.6
When I downgrade to version 2.1.3, the problem just gone.
I meet the same problem this is demo adress https://codepen.io/djlxiaoshi/pen/PQwNJN
@6769 This is indeed a problem in the new version.
ref issue 2177
Most helpful comment
hi, guys, I met the same problem as yours, which I can't input more than two characters to
Modal.promt,and none of inputed characters were shown in the input zone.Win10 ,chrome version: 63.0.3239.84 x64
For a minimal reproduce case at CodePen :
And this is the local package dependencies, seems no differences with 2.1.3 :
When I downgrade to version 2.1.3, the problem just gone.