internal void OnSelectClick(MouseEventArgs e) { if (EnableClearButton) { EnableClearButton = false; return; } if (PopupService.SelectDropDownOptions.Any(x => x.Target.Id == elementSelect.Id)) { return; } dropDownOption = new DropDownOption() { IsTree = isTree, Select = this, Target = elementSelect, OptionContent = ChildContent, Refresh = () => { StateHasChanged(); }, IsShow = true }; PopupService.SelectDropDownOptions.Add(dropDownOption); }
internal async Task CloseDropDownAsync(DropDownOption option) { option.IsShow = false; if (GlobalElementSettings.DisableAnimation) { PopupService.SelectDropDownOptions.Remove(option); PopupService.DropDownMenuOptions.Remove(option); option.Refresh?.Invoke(); return; } option.HideStatus = AnimationStatus.Begin; StateHasChanged(); await Task.Delay(10); option.HideStatus = AnimationStatus.End; StateHasChanged(); await Task.Delay(200); PopupService.SelectDropDownOptions.Remove(option); PopupService.DropDownMenuOptions.Remove(option); option.Refresh?.Invoke(); }