ant-design-blazor/components/core/JsInterop
Tony Yip 4b04f09832 perf: avoid memory leak issue of event listener (#1857)
* perf: avoid memory leak #1834

Avoid memory leak by remove the exclusive parameter and logic in the code block on AddEventListener method in DomEventService class.

The following are the components affected:
components/affix/Affix.razor.cs
components/anchor/Anchor.razor.cs
components/carousel/Carousel.razor.cs
components/core/Component/Overlay/Overlay.razor.cs
components/core/Component/Overlay/OverlayTrigger.razor.cs
components/core/JsInterop/DomEventService.cs
components/descriptions/Descriptions.razor.cs
components/dropdown/DropdownButton.cs
components/grid/Row.razor.cs
components/input/Input.cs
components/input/TextArea.razor.cs
components/layout/Sider.razor.cs
components/list/ListItem.razor.cs
components/select/Select.razor.cs
components/select/internal/SelectContent.razor.cs
components/slider/Slider.razor.cs
components/table/Table.razor.cs
components/tabs/Tabs.razor.cs

* fix override AddEventListener method in AntDesign.TestKit project

* add register/remove event listerner for exclusive use in DomEventService class

* move _dotNetObjects to DomEventListerner class/service, so that users not required to maintain it in each component.

* * move share/reuse dom event listerner methods to DomEventListerner class

* remove method 'AddEventListener' that no longer exists in DomEventService class in AntDesign.TestKit project

* * change the component referring to an IDomEventListerner interface instead of a concrete class,
  so that the component can be tested via a mock TestDomEventListerner.

* introduce DisposeShared and Dispose method in DomEventListerner to ease user remove callback from DomEventListerner

* register IDomEventListerner into DI container instead of create manually

* fix FormatKey

* fix FormatKey

* fix tests

* fix test

* fix test

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2021-09-09 12:56:11 +08:00
..
EventArg refactor: change namespcae to AntDesign 2020-05-29 00:33:49 +08:00
modules fix(module: textarea): add rows parameter (#1920) 2021-09-07 13:46:34 +08:00
ObservableApi refactor(interop): reorganization into classes and typescript tests (#1791) 2021-07-29 22:45:47 +08:00
DomEventListener.cs perf: avoid memory leak issue of event listener (#1857) 2021-09-09 12:56:11 +08:00
DomEventService.cs perf: avoid memory leak issue of event listener (#1857) 2021-09-09 12:56:11 +08:00
DomEventSubscription.cs perf: avoid memory leak issue of event listener (#1857) 2021-09-09 12:56:11 +08:00
DomRect.cs feat: add element component (#1378) 2021-04-17 22:14:01 +08:00
HtmlElement.cs fix(module: input): preserve focus and caret position for input password when visibility is toggled (#1377) 2021-04-18 08:06:06 +00:00
IDomEventListener.cs perf: avoid memory leak issue of event listener (#1857) 2021-09-09 12:56:11 +08:00
interop.ts refactor(interop): reorganization into classes and typescript tests (#1791) 2021-07-29 22:45:47 +08:00
InteropService.cs docs: fix anchor and improvement (#1107) 2021-02-06 19:27:48 +08:00
JSInteropConstants.cs fix(module: textarea): add rows parameter (#1920) 2021-09-07 13:46:34 +08:00
Window.cs refactor: layout and mock-browser (#184) 2020-06-03 23:11:02 +08:00