@@ -163,6 +163,100 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) =>
163163 await expect ( ionChange ) . toHaveReceivedEventDetail ( { value : 12 } ) ;
164164 await expect ( column ) . toHaveJSProperty ( 'value' , 12 ) ;
165165 } ) ;
166+
167+ test ( 'should allow typing 22 in a column where the max value is 23 and not just set it to 2' , async ( { page } ) => {
168+ await page . setContent (
169+ `
170+ <ion-picker>
171+ <ion-picker-column></ion-picker-column>
172+ </ion-picker>
173+
174+ <script>
175+ const column = document.querySelector('ion-picker-column');
176+ column.numericInput = true;
177+ const items = [
178+ { text: '01', value: 1 },
179+ { text: '02', value: 2},
180+ { text: '20', value: 20 },
181+ { text: '21', value: 21 },
182+ { text: '22', value: 22 },
183+ { text: '23', value: 23 }
184+ ];
185+
186+ items.forEach((item) => {
187+ const option = document.createElement('ion-picker-column-option');
188+ option.value = item.value;
189+ option.textContent = item.text;
190+
191+ column.appendChild(option);
192+ });
193+ </script>
194+ ` ,
195+ config
196+ ) ;
197+
198+ const column = page . locator ( 'ion-picker-column' ) ;
199+ const ionChange = await page . spyOnEvent ( 'ionChange' ) ;
200+ await column . evaluate ( ( el : HTMLIonPickerColumnElement ) => el . setFocus ( ) ) ;
201+
202+ // Simulate typing '22'
203+ await page . keyboard . press ( 'Digit2' ) ;
204+ await page . keyboard . press ( 'Digit2' ) ;
205+
206+ // Ensure the column value is updated to 22
207+ await expect ( ionChange ) . toHaveReceivedEventDetail ( { value : 22 } ) ;
208+ await expect ( column ) . toHaveJSProperty ( 'value' , 22 ) ;
209+ } ) ;
210+
211+ test ( 'should set value to 2 and not wait for another digit when max value is 12' , async ( { page } ) => {
212+ await page . setContent (
213+ `
214+ <ion-picker>
215+ <ion-picker-column></ion-picker-column>
216+ </ion-picker>
217+
218+ <script>
219+ const column = document.querySelector('ion-picker-column');
220+ column.numericInput = true;
221+ const items = [
222+ { text: '01', value: 1 },
223+ { text: '02', value: 2 },
224+ { text: '03', value: 3 },
225+ { text: '04', value: 4 },
226+ { text: '05', value: 5 },
227+ { text: '06', value: 6 },
228+ { text: '07', value: 7 },
229+ { text: '08', value: 8 },
230+ { text: '09', value: 9 },
231+ { text: '10', value: 10 },
232+ { text: '11', value: 11 },
233+ { text: '12', value: 12 }
234+ ];
235+
236+ items.forEach((item) => {
237+ const option = document.createElement('ion-picker-column-option');
238+ option.value = item.value;
239+ option.textContent = item.text;
240+
241+ column.appendChild(option);
242+ });
243+ </script>
244+ ` ,
245+ config
246+ ) ;
247+
248+ const column = page . locator ( 'ion-picker-column' ) ;
249+ const ionChange = await page . spyOnEvent ( 'ionChange' ) ;
250+ await column . evaluate ( ( el : HTMLIonPickerColumnElement ) => el . setFocus ( ) ) ;
251+
252+ // Simulate typing '2'
253+ await page . keyboard . press ( 'Digit2' ) ;
254+
255+ // Ensure the value is immediately set to 2
256+ await expect ( ionChange ) . toHaveReceivedEventDetail ( { value : 2 } ) ;
257+ await expect ( column ) . toHaveJSProperty ( 'value' , 2 ) ;
258+ } ) ;
259+
166260 test ( 'pressing Enter should dismiss the keyboard' , async ( { page } ) => {
167261 test . info ( ) . annotations . push ( {
168262 type : 'issue' ,
0 commit comments