feat(picker-column-internal): add ability to disable items (#25412)

This commit is contained in:
Liam DeBeasi
2022-06-07 11:27:25 -04:00
committed by GitHub
parent 01c40eae55
commit 8b7c07968e
6 changed files with 219 additions and 9 deletions

View File

@ -303,7 +303,7 @@ export class PickerInternal implements ComponentInterface {
return;
}
const values = inputModeColumn.items;
const values = inputModeColumn.items.filter((item) => item.disabled !== true);
/**
* If users pause for a bit, the search
@ -374,7 +374,7 @@ export class PickerInternal implements ComponentInterface {
zeroBehavior: 'start' | 'end' = 'start'
) => {
const behavior = zeroBehavior === 'start' ? /^0+/ : /0$/;
const item = colEl.items.find(({ text }) => text.replace(behavior, '') === value);
const item = colEl.items.find(({ text, disabled }) => disabled !== true && text.replace(behavior, '') === value);
if (item) {
colEl.value = item.value;