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(table): row selection: space after checkbox incorrect #1272

Merged
merged 15 commits into from
Nov 23, 2022

Conversation

hannahiss
Copy link
Member

Add a negative right margin to adjust space in that case

Closes #1236

@netlify
Copy link

netlify bot commented May 20, 2022

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit c5f0af3
🔍 Latest deploy log https://app.netlify.com/sites/boosted/deploys/637dc483c27dc00009c856e9
😎 Deploy Preview https://deploy-preview-1272--boosted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

Out of context but, did you try changing the html structure ? (without the div.form-check for example)

scss/_tables.scss Outdated Show resolved Hide resolved
Copy link
Member

@louismaximepiton louismaximepiton left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@julien-deramond
Copy link
Member

There's no way here to have 40px x 40px? It seems to be like that in the DSM.

Screenshot from 2022-06-09 08-07-09

@julien-deramond
Copy link
Member

With margin-right: -1.024rem we have a <td> width of:

  • Ubuntu / Firefox: 40px
  • Ubuntu / Chrome: 40.02px
    What about Windows? If we have the same values (really close to 40px) we could go for this -1.024rem 🤷

@louismaximepiton
Copy link
Member

After digging a bit more inside tables, it appears that the columns take as much place as they can. This is why we have such weird sizes (you can try resize your window and you won't have the same size). Here is a workaround to have exactly 40px at each breakpoint (on first column):

<table class="table table-sm table-hover table-responsive">

  <colgroup>
    <col style="2.5rem">
  </colgroup>

  <thead>
  </thead>
  <tbody>
  </tbody>
</table>

Here the 2.5rem is arbitrary, I didn't check if another value could be better here

… to 1rem (sufficient to prevent second column to move to the right)
@hannahiss
Copy link
Member Author

Louis-Maxime's solution seems good and well supported by all browsers, so I added colgroup to fix first column width.
Concerning the negative right margin, it is still needed to prevent second column to move to the right, but 1rem seems ok and cleaner that 1,0625rem or -1.024rem.

@hannahiss
Copy link
Member Author

@julien-deramond I'm going to update migration guide too ;-)

Copy link
Member

@julien-deramond julien-deramond left a comment

Choose a reason for hiding this comment

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

LGTM. Just a suggestion to improve the migration guide note.

scss/_tables.scss Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Nov 23, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@julien-deramond julien-deramond merged commit ef7a803 into main Nov 23, 2022
@julien-deramond julien-deramond deleted the main-his-row-selection-space branch November 23, 2022 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs > Tables > Row selection: space after checkbox incorrect
3 participants