Skip to content

Commit

Permalink
fix: 修复数字框在iframe中,输入状态下自动格式化了 (#11425)
Browse files Browse the repository at this point in the history
  • Loading branch information
F-jianchao authored Dec 25, 2024
1 parent 237d511 commit fadde7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/amis/src/renderers/Form/InputNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ export default class NumberControl extends React.Component<
) => {
// 增加千分分隔
if (kilobitSeparator && value) {
if (userTyping) {
if (userTyping || this.input === document.activeElement) {
// 如果是用户输入状态,则只进行千分隔处理,避免光标乱跳
let parts = value.toString().split('.');
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
Expand Down

0 comments on commit fadde7d

Please sign in to comment.