Skip to content

Commit

Permalink
fix(输入框): 输入框focus状态错误修改
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoyinglong committed Apr 11, 2018
1 parent 85b2547 commit 548b8c0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ export default class plateNumberInput {
*/
setNumberType(isNewpower = false) {
this.isNewpower = isNewpower;
const lastIndex = this.inputSpans.length - 1;
if (!this.spareSpan.parentNode && isNewpower) {
this.containerInput.appendChild(this.spareSpan);
}
if (this.spareSpan.parentNode && !isNewpower) {
this.containerInput.removeChild(this.spareSpan);
}
console.log(this.inputSpans.length);
this.setInputFocus(this.inputSpans.length - 1);
const index = this.currentIndex === lastIndex ? this.inputSpans.length - 1 : this.currentIndex;
this.setInputFocus(index);
this.setBtnSaveActive();
}
/**
Expand Down

0 comments on commit 548b8c0

Please sign in to comment.