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

feat: nested selection host support for IR-extension #618

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Xiaoy312
Copy link
Contributor

@Xiaoy312 Xiaoy312 commented Jun 16, 2023

GitHub Issue (If applicable): closes #611, re: #610

PR Type

What kind of change does this PR introduce?

  • Feature

What is the new behavior?

  • Add nested selection host support for IR-extension
  • Add temp workaround for IR-ext selection not working on wasm/droid

PR Checklist

Please check if your PR fulfills the following requirements:

@Xiaoy312 Xiaoy312 force-pushed the dev/xygu/20230616/ir-nested-selection-host branch from fbdd764 to 79fd31a Compare June 19, 2023 15:05
@Xiaoy312 Xiaoy312 force-pushed the dev/xygu/20230616/ir-nested-selection-host branch from 79fd31a to efbf622 Compare June 19, 2023 16:38
{
if (x is SelectorItem si)
var host = GetUseNestedSelectionHost(ir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe avoid needing to have both a UseNestedSelectionHost and a IsSelectionHost property? Could we get away with just IsSelectionHost?

Perhaps just search for a selection host if the itemRoot itself is anything other than a SelectorItem or ToggleButton, otherwise assume the root should be the selection host? Or are there common scenarios that this logic wouldn't support?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we absolutely need both properties, perhaps we should bubble up some sort of warning/error when one is used without the other?

}
private static void ApplyNestedTappedEventBlocker(ItemsRepeater ir, DependencyObject itemRoot)
{
Console.WriteLine($"@xy droid:{IsAndroid}, wasm:{IsWasm}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover debug message?

@@ -33,14 +33,22 @@ public static int IndexOf(this ItemsSourceView isv, object item)
}
#endif

/// <summary>
/// Update the selection indexes by toggling the provided index, and then coerced according to the selection mode.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL "indexes" is a thing and you're only supposed to use "indices" in the context of mathematical expressions

@kazo0 kazo0 self-requested a review June 19, 2023 18:31
Comment on lines +201 to +203
// Unlike for selection behaviors, we don't need to find the "selection host".
// The selection host is a unrelated concept in the command setup. Additionally,
// the template root would generally have the same context as the selection host.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Unlike for selection behaviors, we don't need to find the "selection host".
// The selection host is a unrelated concept in the command setup. Additionally,
// the template root would generally have the same context as the selection host.
// Unlike for selection behaviors, we don't need to find the "selection host".
// The selection host is an unrelated concept in the command setup. Additionally,
// the template root would generally have the same context as the "selection host".

@Xiaoy312 Xiaoy312 self-assigned this Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IR-ext] selection support for complex ItemTemplate
3 participants