NG-ZORRO / ng-zorro-antd-mobile

A configurable Mobile UI components based on Ant Design Mobile and Angular. 🐜
http://ng.mobile.ant.design
Other
799 stars 241 forks source link

下拉过半不会选种 #805

Open milabi opened 3 years ago

milabi commented 3 years ago

pickerview下拉选择时,选项一半(50%)已经进入待选框,但不会选种,超过100%未到150%时会选种第二个。 https://github.com/NG-ZORRO/ng-zorro-antd-mobile/blob/cd5216a03536f9069156df4992fe51631c507b2c/components/picker/picker.component.ts#L104-L114 是否改成:

 if (this.differY <= -this.lineHeight / 2) { 
   this.currentY += Math.floor(this.differY / this.lineHeight + 0.5); 
   if (this.currentY <= this.maxY) { 
     this.currentY = this.maxY; 
   } 
 } else if (this.differY >= this.lineHeight / 2) { 
   this.currentY += Math.floor(this.differY / this.lineHeight + 0.5); 
   if (this.currentY >= 0) { 
     this.currentY = 0; 
   } 
 } 

会更合理呢?