-
Notifications
You must be signed in to change notification settings - Fork 156
fix(action-strip): Assign parent to not destroy on DOM move. #16270
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
Open
MayaKirova
wants to merge
8
commits into
20.1.x
Choose a base branch
from
mkirova/fix-15768-20.1.x
base: 20.1.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5ac7a0d
fix(action-strip): Assign parent to not destroy on DOM move.
01683e7
chore(*): Move strip handling after parentComponentRef is populated.
fbd1785
fix(action-strip): Fix timing issues.
a8642fd
fix(igxGridRow): On destroy check for still shown action strip.
ec11d6d
chore(action-strip,elements): minor new lines formatting
damyanpetev 7201841
fix(igxGrid): On detach also check for still shown action strip.
89b1eb8
Merge branch 'mkirova/fix-15768-20.1.x' of https://github.com/IgniteU…
f18b2f4
chore(*): Add null check.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd flip that to:
just so the check doesn't run if there's no context on the strip set at all.
In any case, this is getting to be a bit of a rabbit hole and I got GroupBy and possibly paging as extra cases. So far I've been able to find the grouping scenario with deleting the last row of a group that does the trick and once again there's a rogue

show()
in there (two actually) before the remove:The paging one haven't caught yet.
To that end:
beforeViewDetach
is a very chatty event to just take in general and connect to the specific case.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damyanpetev
The specific scenario shown to me by @MarielaTihova was a grid with paging and groupby (the one in the elements grid sample) where if you keep deleting the last data row until it's replaced by group by row, the action strip gets destroyed.
In that specific scenario the row is not destroyed but instead cached (see the
igxTemplateOutlet
), which means it gets detached and it detaches together with the action strip inside. And since it's removed from the DOM, elements destroys it. We already havebeforeViewDetach
event, which fires before the row detaches, so I just added the same logic there as for the row's destroy handler.Hope it makes more sense now.
Sure I can work on automation either as part of this PR or a separate one, depending on whether @dkamburov wants the fix to be included quicker with the next patch or if it can wait.
I'm open to your suggestions on a better fix if you have one.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I got the grouping case right, but okay.

As for the alternative suggestion, it's been the same as the last two times - try to avoid the extra
show()
when the strip closed itself. That seems to revolve around the mouseenter handeler (should it be pointer instead?), so I tried a check for the related target, excluding children of the row (possibly redundant) and children of the action strip itself:That handles the initial bug just fine from what I saw (delete the single root of the Tree Grid in Elements demo) and the Grouping scenario (delete the last row of a group). Still something iffy on open from when another row takes the place under the cursor after delete and I have to move to show the strip so the check might need smth extra, but it doesn't break in any of the cases at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also track enter/leave as state, don't believe there's a leave in-between those multiple enters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damyanpetev Since you already have the changes locally, might as well commit and make a PR, if that's ok with you. I'll close mine as redundant.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, what I posted on top was what I have. However, as I said it doesn't quite work since there's a secondary
show()
on the "deleted" row that's ignored, but that row is 'replaced' by the next in context and that's how it works in main right now - the strip self-closes and the row opens it back up immediately, the delete overrides the context and the strip somehow remains open on the same DOM row and works fine. So attempting to avoid the open.. is odd. We might need to discuss further.TLDR: The behavior I'm trying to avoid is what we apparently rely on to handle normal delete scenarios, which is a bit baffling.