Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Overlay] Fix the detection of ExcludedElement for WASM #2755

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13959,6 +13959,12 @@
Light variant of FluentUI System Icons
</summary>
</member>
<member name="F:Microsoft.FluentUI.AspNetCore.Components.IconVariant.Color">
<summary>
Color variant of FluentUI System Icons
> Note: FOR TESTING ONLY. This variant is not supported yet in the FluentUI System Icons.
</summary>
</member>
<member name="T:Microsoft.FluentUI.AspNetCore.Components.InputFileMode">
<summary>
How to handle the input file(s).
Expand Down
2 changes: 0 additions & 2 deletions src/Core/Components/List/FluentAutocomplete.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,6 @@ protected override async Task InputHandlerAsync(ChangeEventArgs e)
await OnOptionsSearch.InvokeAsync(args);
}

Console.WriteLine($"args.Items: {args.Items?.Count()}");

Items = args.Items?.Take(MaximumOptionsSearch);

SelectableItem = Items != null
Expand Down
16 changes: 7 additions & 9 deletions src/Core/Components/Overlay/FluentOverlay.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ export function overlayInitialize(dotNetHelper, containerId, id) {

// Click event handler
clickHandler: async function (event) {
const excludeElement = document.getElementById(id);
const isExcludeElement = excludeElement && excludeElement.contains(event.target);
const isInsideContainer = isClickInsideContainer(event, containerId);
const isInsideContainer = isClickInsideContainer(event, document.getElementById(containerId));
const isInsideExcludedElement = !!document.getElementById(id) && isClickInsideContainer(event, document.getElementById(id));

if (isInsideContainer && !isExcludeElement) {
dotNetHelper.invokeMethodAsync('OnCloseInteractiveAsync', event);
if (isInsideContainer && !isInsideExcludedElement) {
dotNetHelper.invokeMethodAsync('OnCloseInteractiveAsync', event);
}
}
};
Expand All @@ -48,11 +47,10 @@ export function overlayDispose(id) {
}

/**
* Determines whether a mouse click event occurred inside a specific HTML element identified by its `id`.
* Determines whether a mouse click event occurred inside a specific HTML element.
*/
function isClickInsideContainer(event, id) {
if (id && document.getElementById(id)) {
const container = document.getElementById(id);
function isClickInsideContainer(event, container) {
if (!!container) {
const rect = container.getBoundingClientRect();

return (
Expand Down
Loading