Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

fix(uiSelect): add class to dropdown instead of simple opacity change… #1936

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dexmaster
Copy link

… to remove flicker

Previous behaviour and new one with punks are in issue #1583.

… to remove flicker

Previous behaviour and new one with punks are in issue angular-ui#1583.
visibility: hidden;
top: 100% !important;
left: 100% !important;
z-index: -1 !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why the important is needed?

Copy link
Author

@Dexmaster Dexmaster Mar 9, 2017

Choose a reason for hiding this comment

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

Because you set top/left/position with propery of DOM element dropdown[0].style.top dropdown[0].style.left dropdown[0].style.position. z-index is additional it hides drobdown behind 0 z-index. May be an overkill if it's already hidden 3 times but to be sure.

@@ -411,7 +411,7 @@ uis.directive('uiSelect',
}

// Reset the position of the dropdown.
dropdown[0].style.opacity = 0;
dropdown[0].classList.add('ui-select-detached');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that this class is already being set before it is in this function?

Copy link
Author

Choose a reason for hiding this comment

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

No it's new class, I haven't added it to templates so it's here first time and we see addition on two sides of if ($select.open) so it's either one or another.
And even if class was added already it will not duplicase as classList.add adds only if not present.

Copy link
Contributor

@Jefiozie Jefiozie left a comment

Choose a reason for hiding this comment

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

Next to the comments I have made could you make some tests around this?
Thanks.

@Dexmaster
Copy link
Author

Dexmaster commented Mar 9, 2017

What tests do you need specifically? It does not change interaction and just replaces opacity with class toggle?

@Dexmaster
Copy link
Author

Dexmaster commented Mar 9, 2017

I can do one test that it will fix by replication issue #1583 itself but I believe to do it for such a small specific issue is a bit of overkill.

@Jefiozie
Copy link
Contributor

Jefiozie commented Mar 9, 2017

I agree on the fact that it looks like a bit of overkill. But as this libary has many issue it is our best check for problems in the future. Could you make it and commit it?

@Dexmaster
Copy link
Author

Dexmaster commented Mar 9, 2017

To this same branch, no problem. I need to add comit with test(uiSelect): PR #1936 or copy same message but starting with test? (eg: test(uiSelect): add class ... etc ... )

@Jefiozie
Copy link
Contributor

Jefiozie commented Mar 9, 2017

i think test(uiSelect): PR #1936 will do. It can be in the same PR (just to be clear 😄 )

@Jefiozie
Copy link
Contributor

Any updates on this issue?

Thanks

@Dexmaster
Copy link
Author

Dexmaster commented Mar 20, 2017

Oops, forgot completely, will take some time tomorrow evening this weekend to clean it up.

@MatejQ
Copy link

MatejQ commented May 22, 2017

We are seeing the same issue as in #1583 however when applying the changes in this PR, it did not help. Looking forward to a proper fix.

@afedosenko
Copy link

Good solution, but doesn't seem to work when $select.$animate is null.

@Jefiozie Jefiozie dismissed their stale review October 7, 2017 19:20

Needs some work after this will proceed review

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants