react-instantsearch icon indicating copy to clipboard operation
react-instantsearch copied to clipboard

fix(SearchBox): RTL support

Open ShaMan123 opened this issue 3 years ago • 12 comments

dir="auto" for rtl auto support

Algolia is AMAZING!!

Thanks

Summary

There is no access to the underlying input element, not able to pass props. dir="auto" is safe for all use cases

Result

a b

ShaMan123 avatar Mar 23 '21 06:03 ShaMan123

workaround

 document.getElementsByClassName('ais-SearchBox-input')[0].setAttribute('dir', 'auto');

ShaMan123 avatar Mar 23 '21 06:03 ShaMan123

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6a9d7bf0d0c96c34f24a895f478f51fa78cb9752:

Sandbox Source
react-instantsearch-app Configuration
hooks-example Configuration

codesandbox-ci[bot] avatar Mar 23 '21 06:03 codesandbox-ci[bot]

Deploy Preview for react-instantsearch ready!

Name Link
Latest commit 6a9d7bf0d0c96c34f24a895f478f51fa78cb9752
Latest deploy log https://app.netlify.com/sites/react-instantsearch/deploys/63973e18130f75000847a6fc
Deploy Preview https://deploy-preview-3037--react-instantsearch.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.

algobot avatar Mar 23 '21 06:03 algobot

this is an interesting PR, we need to do some more checks to see if this is sufficient in every case, but I think in the mean time a different workaround is: .ais-SearchBox-input { direction: auto } via css. Do you confirm that also works?

Haroenv avatar Mar 24 '21 12:03 Haroenv

Unfortunately not. css doesn't support auto value

ShaMan123 avatar Mar 24 '21 13:03 ShaMan123

Sorry for the delay here, we were testing this in other flavours. I'm in favour of adding this attribute by default. Do you think you can update the relevant tests @ShaMan123? Thanks!

Haroenv avatar Apr 30 '21 16:04 Haroenv

Maybe. Could you point me to the relevant tests?

ShaMan123 avatar May 01 '21 05:05 ShaMan123

The snapshot tests are here https://app.circleci.com/pipelines/github/algolia/react-instantsearch/1077/workflows/2876d94c-986f-485d-b16c-ea4073c9c131/jobs/44752 @ShaMan123 :)

Haroenv avatar May 01 '21 14:05 Haroenv

@Haroenv I think it's done.

ShaMan123 avatar May 02 '21 06:05 ShaMan123

We are thinking slightly about whether just this input change is enough @ShaMan123, would you in hebrew expect the icons to be positions reversely too or not?

Haroenv avatar May 06 '21 11:05 Haroenv

Would you in hebrew expect the icons to be positions reversely too or not?

@Haroenv I didn't found much search resources but it looks like only the text position itself changes

shortcuts avatar May 06 '21 11:05 shortcuts

I would expect the text to be positioned to the right and the icons to left.

בתאריך יום ה׳, 6 במאי 2021, 14:33, מאת Clément Vannicatte ‏< @.***>:

Would you in hebrew expect the icons to be positions reversely too or not?

@Haroenv https://github.com/Haroenv I didn't found much search resources https://www.maariv.co.il/#/search;query=test but it looks like only the text position itself changes

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/algolia/react-instantsearch/pull/3037#issuecomment-833451789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGAW4KO46TGLNPKQZU7DYTTMJ47HANCNFSM4ZUQCTAA .

ShaMan123 avatar May 06 '21 15:05 ShaMan123

@ShaMan123 We're in the process of moving algolia/react-instantsearch to our InstantSearch monorepo. This PR won't be transferrable, so I'll close it here, but please feel free to reopen it once the migration is done.

sarahdayan avatar Dec 22 '22 15:12 sarahdayan