ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Column menu weird movement

Open wattsbn opened this issue 12 years ago • 7 comments

There is some weird UI if you open and close the column menu on one column (lets call it column A) and then open it on a different column (column B). In this example, the column menu will first reopen under column A again before moving to column B. This looks like a bug to me, but it seems to have been deliberately coded this way in order to calculate the correct width. // Re-position the menu AFTER it's been shown, so we can calculate the width correctly. I'm not sure what the correct fix is, but it seems odd that you can see it move from one column to the next. I understand if this becomes a low priority bug, but I think it would nice to have this fixed at some point in the future.

wattsbn avatar Sep 30 '14 13:09 wattsbn

It's SORT OF a bug. When animation is enabled the menu will scroll UP from the previous column and then scroll DOWN on the new column.

When the column is already hidden it probably needs to reposition prior to showing the menu. Maybe cache the width from the previous "show" event and use that for the initial position, then recalculate it and reposition again? Different columns can have different menu items so we have to be able to reposition based on what the menu container's contents.

Or we could do all the positioning math with a hidden element (i.e. visibility: none) and then show it.

c0bra avatar Sep 30 '14 16:09 c0bra

I think I've fixed this in #1710. I've changed the menu to:

  1. Hide
  2. Reposition, and to use the last known width, or a default value if not available
  3. Display
  4. Reposition again, and update last known width.

I'm a bit dubious on the animation - it looks like it did before, but it doesn't really look like an animation to me, but it might just be running fast.

An improvement would be to cache "lastWidth" for each column, not just for the menu as a whole. But I only just thought of that now, so it isn't in the code I pushed. :-)

PaulL1 avatar Oct 04 '14 09:10 PaulL1

@PaulL1 the animation does not occur on the tutorials because it breaks the site. With animation enabled, when you navigate between tutorials the new tutorial elements are added to the page before the old tutorial is removed. This causes two sets of the same .grid CSS classes to be on the page and when the new grid has the old styles it causes some nasty miscalculations, thus animations are disabled to prevent this :)

I will need to check #1710 with animations just to double-check.

c0bra avatar Oct 06 '14 13:10 c0bra

This should be fixed with Paul's latest menu changes. I have not seen any problems with the menu other than positioning in IE11.

c0bra avatar Oct 08 '14 20:10 c0bra

More or less on the same topic.. Here is a plnkr with an issue.. http://plnkr.co/edit/2PlUyHOE6JItNg1L9Ztb?p=preview
When click to sort columns it opens the menu .. with move columns and sorting enabled.. Should i open a new bug for this ?

roedit avatar Nov 17 '14 14:11 roedit

A new thing noticed .. Having sorting disabled, column menu disabled , with move columns , the sort remains active. http://plnkr.co/edit/MCaDM7D0e8WpECuxOwgy?p=preview

roedit avatar Nov 17 '14 15:11 roedit

@romcode: this is a closed issue, nobody is going to see things that you add here!!

PaulL1 avatar Nov 18 '14 22:11 PaulL1