igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

IgxTabs: Incorrect layout on first page load

Open rmkrmk opened this issue 7 years ago • 3 comments

Description

The IgxTabs component has incorrect selection indicator length and content position on first page load.

  • igniteui-angular version: 8.1.x
  • browser: all

Steps to reproduce

  1. Start dev demos.
  2. Load "Tabs" sample. (At this point all tabs demos should look correct)
  3. Reload the page with Ctrl+F5 or F5

Result

The selected tab's selection indicator is longer than the tab itself (mostly visible on first and last sample). The content of the selected tab is not fully scrolled and visible. (see screenshots)

Expected result

All selection indicators should have width equal to the width of the respective tab item. The selected tab's content should be left and right aligned with the IgxTabs component.

Attachments

image

rmkrmk avatar Aug 05 '19 12:08 rmkrmk

I've investigated the issue and it looks like the component's logic is setting such a large initial width on the selection indicator because of the larger width initially reported by the tab items container. Also I noticed that the described issue is not observable when setting the new themes ("fluent-excel-theme" and "fluent-excel-dark-theme").

@desig9stein can you please take a look what may be the difference between the themes and what may be causing the issue.

rmkrmk avatar Sep 02 '19 13:09 rmkrmk

It appears that this is a problem with the sample max-width. If the max-width is in % we can observe the issue, if we use 'px' the problem is gone. I will furder investigate to see if its a styling issue.

desig9stein avatar Sep 09 '19 08:09 desig9stein

Ок, after some further investigation I noticed that even if we don't add default width (tabs take the full width of their parent) the problem is there but only appears after the browser window is resized and we refresh the page. I don't see any connection between the styling and the calculated width of the active tab indicator. Also after the problem appear if we resize the browser window the width is recalculated correctly. I think that the problem is with the way that we calculate the width of the active indicator. @DiyanDimitrov could you please take a second look at the problem.

To reproduce:

  1. open the tabs page in dev demos
  2. resize the browser window with 200/300px
  3. refresh the page with Ctrl+F5 or F5

desig9stein avatar Sep 09 '19 10:09 desig9stein