Giter VIP home page Giter VIP logo

Comments (4)

dohomi avatar dohomi commented on May 29, 2024

@Carbowix could you open a PR which provides a fix? I honestly don't have any setup in place to handle RTL views . I honestly think that this might be needed on multiple places? Otherwise if its only the right prop that fix could be easily handled via a prop at this component

from tamagui-kitchen-sink.

Carbowix avatar Carbowix commented on May 29, 2024

@dohomi doesn't really need a special setup, tamagui is already perfectly aligning the elements according to the direction and I only just use the direction={languageDirection} on stacks and input fields. i18n already provides a function to detect the language's favored direction which makes it easy to manage over the whole user interface.
I did a small test with your repo and it works alright I guess, but I'm not sure if there are any other edits needed, because I barely have enough knowledge to traverse mono-repos already.

Here's a small glimpse of the edits:
It should be enough to fix the icon positioning. I'll be happy to PR it if the edits are fine.

// features/playground.tsx
// Just a test and to showcase the rtl
 <LmInputRhf direction='rtl' isPassword={true} name={'textfield'} label={'Textfield'} />
// form/src/LmInput.tsx
// Added the direction property
export function LmInput({
 direction,
 required,
 ....,
 })
 
 let isRTL = direction == 'rtl'
 // Further into the jsx elements
 <Input
           direction={direction}
           {...currentInputProps}
           secureTextEntry={!show}
           autoCapitalize="none"
           placeholderTextColor={rest.placeholderTextColor as InputProps['placeholderTextColor']}
         />
         <Pressable
           style={{
             position: 'absolute',
             top: '50%',
             transform: [{ translateY: -0.5 * 20 }],
             height: 20,
             [isRTL ? 'left' : 'right']: 15
           }}
           onPress={() => {
             setShow((state) => !state)
           }}
         >
          {show ? (
             <EyeSlashRegular {...passwordIconProps} />
           ) : (
             <EyeRegular {...passwordIconProps} />
           )}
         </Pressable>

image

from tamagui-kitchen-sink.

dohomi avatar dohomi commented on May 29, 2024

@Carbowix I followed your example and added the changes in the new release. I append an example to Storybook:
https://tamagui-extras.vercel.app/?path=/story/form-input--password-right-to-left

from tamagui-kitchen-sink.

Carbowix avatar Carbowix commented on May 29, 2024

Thank you. I'll update and report if any issues appear in the future.

from tamagui-kitchen-sink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.