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

fix(core/tabs): tab layout stretched and showNextArrow #345

Merged
merged 9 commits into from
Feb 14, 2023

Conversation

goncalosard
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (yarn build) was run locally and any changes were pushed
  • Unit tests (yarn test) were run locally and passed
  • Visual Regression Tests (yarn visual-regression) were run locally and passed
  • Linting (npm lint) was run locally and passed

Pull request type

Please check the type of change your PR introduces:

  • Bug fix
  • Feature
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

GitHub Issue Number: #338

What is the new behavior?

Now layout="stretched" is working correctly.

Also fixed right arrow (showNextArrow), when overflow exists. Previously it was not showing when layout="auto" and overflow existed. Now it works correctly.

Does this introduce a breaking change?

  • Yes
  • No

Testing

Tested locally.

Other information

@goncalosard goncalosard added type: bug Something isn't working component: core labels Feb 1, 2023
@goncalosard goncalosard linked an issue Feb 1, 2023 that may be closed by this pull request
@danielleroux danielleroux added pull request affects patch version The pull request affects only patch version and removed type: bug Something isn't working component: core labels Feb 1, 2023
@danielleroux danielleroux added this to the 1.4.0 milestone Feb 2, 2023
@danielleroux
Copy link
Collaborator

@goncalosard

Tested it with the following snippet:

        <div
          style={{
            display: 'block',
            position: 'relative',
            width: '40rem',
            backgroundColor: '#ff00002e',
          }}
        >
          <ix-tabs layout="stretched">
            <ix-tab-item>Test</ix-tab-item>
            <ix-tab-item>Test</ix-tab-item>
            <ix-tab-item>Test</ix-tab-item>
            <ix-tab-item>Test</ix-tab-item>
          </ix-tabs>
        </div>

The tabs are not streched over the complete parent size:
image

@goncalosard
Copy link
Contributor Author

@danielleroux

Fixed. Tested with your code and it workes fine now.

@danielleroux
Copy link
Collaborator

danielleroux commented Feb 8, 2023

@danielleroux

Fixed. Tested with your code and it workes fine now.

Please look into the visual-test results (https://github.com/siemens/ix/actions/runs/4115644754 download is on the bottom) seems there are problems regarding the ix-menu-about component.

@danielleroux
Copy link
Collaborator

danielleroux commented Feb 8, 2023

@goncalosard checked out latest version. Test is not failing (😶 i will adapt this if the feature is working) but now iam not getting the correct overflow arrow.

Maybe you should add an unit test to test the overflow behavior.

    <div style="margin-bottom: 2rem; width: 40rem; background-color: #ff00006a">
      <ix-tabs>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
        <ix-tab-item>Example</ix-tab-item>
      </ix-tabs>
    </div>

Result: No overflow on right side:

image

Copy link
Collaborator

@danielleroux danielleroux left a comment

Choose a reason for hiding this comment

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

lgtm

@danielleroux danielleroux merged commit a8bbca8 into main Feb 14, 2023
@danielleroux danielleroux deleted the fix/tabs-stretched branch February 14, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull request affects patch version The pull request affects only patch version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs with layout stretched not working
2 participants