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

Fixed Table Header click for options dropdown #9300

Merged
merged 3 commits into from
Jan 1, 2025

Conversation

harshrajeevsingh
Copy link
Contributor

Fixes: #9286

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Fixed table header cell interaction by extending the clickable area to span the full width, improving dropdown options accessibility in the record table.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@harshrajeevsingh harshrajeevsingh marked this pull request as draft December 31, 2024 14:12
@harshrajeevsingh harshrajeevsingh marked this pull request as ready for review December 31, 2024 14:37
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

No major changes found since last review. The only modification is changing the CSS selector from & > div to & > :first-of-type in StyledColumnHeadContainer, which is just an alternative implementation of the same fix that was already covered in the previous review.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@FelixMalfait
Copy link
Member

Hey great! I checked and it works but to be honest I don't understand the fix. Would you mind explaining / do you know when this bug was introduced? Thanks a lot

@harshrajeevsingh
Copy link
Contributor Author

@FelixMalfait The StyledColumnHeadContainer has a dropdown: RecordTableColumnHeadWithDropdown which is just a styled version of the Dropdown. The dropdown has a simple unstyled div for the clickableComponent. This unstyled div doesn't take the full width of it's parent. Therefore, clicking on the StyledColumnHeadContainer 's empty area doesn't open the dropdown.

Screenshot from 2024-12-31 20-18-13

Screencast.from.2024-12-31.20-31-51.webm

I could have resolved it by styling that particular unstyled div to take the full width of its parent. This is much simpler. However, this could have caused regression to other components with the dropdown. So, for the safer side, I went with targeting that div from the StyledColumnHeadContainer and giving it flex: 1 to take the full space.

@harshrajeevsingh
Copy link
Contributor Author

@FelixMalfait I will try once going with the first approach of styling that div with width: 100%. If I don't find any regression, we can go with it.

@FelixMalfait
Copy link
Member

Very clear thank you @harshrajeevsingh! I agree 100% would be more clear to the external reader. Let us know if it works or not and if not I agree we should merge your fix!

@harshrajeevsingh
Copy link
Contributor Author

@FelixMalfait It seems that my intuition was correct here :) Giving width: 100% to that div causes regression in other components.

Screencast.from.2025-01-01.02-01-07.webm

Screenshot from 2025-01-01 01-56-15

Copy link
Member

@FelixMalfait FelixMalfait left a comment

Choose a reason for hiding this comment

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

Thank you!

@FelixMalfait FelixMalfait merged commit 3544a49 into twentyhq:main Jan 1, 2025
20 checks passed
Copy link

github-actions bot commented Jan 1, 2025

Fails
🚫

node failed.

Log

�[31mError: �[39m SyntaxError: Unexpected token C in JSON at position 0
    at JSON.parse (<anonymous>)
�[90m    at parseJSONFromBytes (node:internal/deps/undici/undici:5584:19)�[39m
�[90m    at successSteps (node:internal/deps/undici/undici:5555:27)�[39m
�[90m    at fullyReadBody (node:internal/deps/undici/undici:1665:9)�[39m
�[90m    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)�[39m
�[90m    at async specConsumeBody (node:internal/deps/undici/undici:5564:7)�[39m
danger-results://tmp/danger-results-dd30e3d9.json

Generated by 🚫 dangerJS against 59eda08

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

Successfully merging this pull request may close these issues.

Clicking on the record table header's empty area doesn't show option until clicked on it's text
2 participants