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(NcActionButton): RTL support #6200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

falghamdi125
Copy link

@falghamdi125 falghamdi125 commented Nov 8, 2024

Hello
This PR fixes padding in RTL mode for NcActionButton.

☑️ Resolves

🖼️ Screenshots

🏚️ Before 🏡 After
01 image
004 005

@falghamdi125 falghamdi125 force-pushed the fix-ncaction-button-padding-in-rtl branch 2 times, most recently from ca9deaa to 6d4b55a Compare November 8, 2024 23:37
@ShGKme ShGKme added bug Something isn't working 3. to review Waiting for reviews feature: actions Related to the actions components labels Nov 11, 2024
@ShGKme ShGKme added this to the 8.20.0 milestone Nov 11, 2024
@ShGKme ShGKme changed the title Fix(NcActionButton): Add RTL support to NcActionButton component fix(NcActionButton): RTL support Nov 11, 2024
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.62%. Comparing base (38d3afe) to head (d9a0e94).
Report is 306 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6200      +/-   ##
==========================================
+ Coverage   37.86%   42.62%   +4.76%     
==========================================
  Files         148      154       +6     
  Lines        5261     4040    -1221     
  Branches     1577     1017     -560     
==========================================
- Hits         1992     1722     -270     
+ Misses       3185     2206     -979     
- Partials       84      112      +28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 78 to 81
body[dir=rtl] &.arrow-left-icon,
body[dir=rtl] &.chevron-right-icon {
transform: scaleX(-1);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about this part. It mirrors all the arrow-like icons in NcAction button, link, text elements.

Copy link
Author

Choose a reason for hiding this comment

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

These two arrow icons are used to indicate a direction within the interface.

One way to resolve this issue is to modify the .vue file that sets the icons’ direction based on the interface mode. Alternatively, we can flip these icons horizontally using CSS, which is the approach I took.

Copy link
Contributor

Choose a reason for hiding this comment

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

These two arrow icons are used to indicate a direction within the interface.

But these styles are wide. It affects all arrow-like icons inside these components. Not specifically "submenu" or "back" buttons.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @ShGKme

Also I am not sure this should be handled by the library, because there might be use cases for left and right like the physical direction. It should probably be handled by the app instead.
Maybe we should either provide something like NcIconArrowStart and NcIconArrowEnd or a directive to flip if is RTL like <IconArrayLeft v-rtl-icon />.

Copy link
Author

@falghamdi125 falghamdi125 Nov 11, 2024

Choose a reason for hiding this comment

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

What if we use NcPopover and NcActionButton to come up with something like NcContextMenu which handles submenus and draws arrows if menu item has children.

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we use NcPopover and NcActionButton to come up with something like NcContextMenu which handles submenus and draws arrows if menu item has children.

Submenu is already (partly) a feature of NcActions. NcActionButton renders that chevron-right-icon for isMenu buttons.

The back button is not, but could be solved via #6209

Copy link
Author

Choose a reason for hiding this comment

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

I removed the arrows modifications. Now the PR only fixes the padding.

Copy link
Contributor

@hamza221 hamza221 left a comment

Choose a reason for hiding this comment

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

I agree about what's mentioned above regarding the icon,
everything else looks good ✅

@Antreesy Antreesy modified the milestones: 8.20.0, 8.20.1 Nov 11, 2024
@falghamdi125 falghamdi125 force-pushed the fix-ncaction-button-padding-in-rtl branch from 6d4b55a to 1984091 Compare November 12, 2024 12:08
@falghamdi125 falghamdi125 force-pushed the fix-ncaction-button-padding-in-rtl branch from 1984091 to d9a0e94 Compare November 14, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working feature: actions Related to the actions components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] NcActionButton incorrect padding in RTL mode
5 participants