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

feat(useTextDirection): new function #1678

Merged
merged 5 commits into from Jul 24, 2022
Merged

feat(useTextDirection): new function #1678

merged 5 commits into from Jul 24, 2022

Conversation

iChengbo
Copy link
Contributor

@iChengbo iChengbo commented Jun 10, 2022

Description

The dir global attribute is an enumerated attribute that indicates the directionality of the element's text.

Some languages are written from right to left, such as Arabic and Hebrew, So, when using i18n, it needs useDir to get the ref(dir) of the element.

reactive RTL mode. #1168

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@antfu
Copy link
Member

antfu commented Jun 16, 2022

useDir reads a bit too general to me, witch it might be interpreted as Directory or something else. Maybe we could have useRTL or useTextDirection?

@michealroberts
Copy link
Contributor

I would perhaps rename this to useRTLTextDirection() or useTextDirection().

@iChengbo
Copy link
Contributor Author

@antfu @michealroberts
The useDir is named based on the name of the property,, but it is really a bit confusing. And compared to useRTL and useRTLTextDirection, I think useTextDirection is more appropriate, so I will rename it.

@iChengbo iChengbo changed the title feat(useDir): new function feat(useTextDirection): new function Jun 17, 2022
@antfu antfu enabled auto-merge (squash) July 24, 2022 09:59
@antfu antfu merged commit 085be3c into vueuse:main Jul 24, 2022
@iChengbo iChengbo deleted the useDir branch July 26, 2022 00:34
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.

None yet

3 participants