diff --git a/components/core/JsInterop/interop.ts b/components/core/JsInterop/interop.ts index 995282a6..c0dbaa74 100644 --- a/components/core/JsInterop/interop.ts +++ b/components/core/JsInterop/interop.ts @@ -156,10 +156,12 @@ export function getBoundingClientRect(element) { export function addDomEventListener(element, eventName, preventDefault, invoker) { let callback = args => { const obj = {}; - for (let k in args) { - obj[k] = args[k]; - } - let json = JSON.stringify(obj, (k, v) => { + for (let k in args) { + if (k !== 'originalTarget') { //firefox occasionally raises Permission Denied when this property is being stringified + obj[k] = args[k]; + } + } + let json = JSON.stringify(obj, (k, v) => { if (v instanceof Node) return 'Node'; if (v instanceof Window) return 'Window'; return v; @@ -177,7 +179,7 @@ export function addDomEventListener(element, eventName, preventDefault, invoker) window.addEventListener(eventName, callback); } } else { - let dom = getDom(element); + let dom = getDom(element); (dom as HTMLElement).addEventListener(eventName, callback); } } diff --git a/components/select/Select.razor.cs b/components/select/Select.razor.cs index 9d813548..34db9f66 100644 --- a/components/select/Select.razor.cs +++ b/components/select/Select.razor.cs @@ -1391,6 +1391,15 @@ namespace AntDesign { CustomTagSelectOptionItem.Label = searchValue; CustomTagSelectOptionItem.Value = value; + if (_isPrimitive) + { + CustomTagSelectOptionItem.Item = (TItem)TypeDescriptor.GetConverter(typeof(TItem)).ConvertFromInvariantString(_searchValue); + } + else + { + typeof(TItem).GetProperty(LabelName).SetValue(CustomTagSelectOptionItem.Item, _searchValue); + typeof(TItem).GetProperty(ValueName).SetValue(CustomTagSelectOptionItem.Item, value); + } } } } diff --git a/components/select/internal/SelectContent.razor b/components/select/internal/SelectContent.razor index 13fb9f53..c8e7c052 100644 --- a/components/select/internal/SelectContent.razor +++ b/components/select/internal/SelectContent.razor @@ -2,131 +2,123 @@ @namespace AntDesign.Select.Internal @typeparam TItemValue @typeparam TItem - -