Beispiel #1
0
        public async Task SelectValue(string optionValue)
        {
            UnselectAll();

            Select2Option <TValue> option = Options.First(p => p.Equals(ChangeType(optionValue)));

            await SelectItem(option);

            StateHasChanged();
        }
Beispiel #2
0
        protected override async Task OnParametersSetAsync()
        {
            if (Options != null && Options.Any() && Options.Any(o => o.Selected))
            {
                SelectedOption = Options.First(o => o.Selected);
            }
            else
            {
                SelectedOption = null;
            }

            FilteredOptions = Options;
        }
Beispiel #3
0
        private async Task SelectItem(Select2Option <TValue> option)
        {
            option.Select();
            SelectedOption = option;

            CurrentValue = option.Value;

            if (OnValueSelected.HasDelegate)
            {
                await OnValueSelected.InvokeAsync(CurrentValue);
            }

            var module = await moduleTask.Value;
            await module.InvokeVoidAsync(
                "removeEventListener",
                UlInternalId);

            IsOpen = false;
        }
Beispiel #4
0
        protected async Task SelectValue(Select2Option <TValue> option)
        {
            UnselectAll();

            await SelectItem(option);
        }