Comments (4)
@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.
@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>
from tamagui-kitchen-sink.
@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.
Thank you. I'll update and report if any issues appear in the future.
from tamagui-kitchen-sink.
Related Issues (20)
- App crashes on Android when LmInputRhf has isPassword={true} HOT 10
- Phosphor icons doubles js bundle size HOT 6
- Datepicker doesn't fill width HOT 2
- No native ExponentConstants module found, are you sure the expo-constants's module is linked properly? HOT 2
- DateTime Picker is not taking up full space HOT 13
- LmAvatar is crashing Expo Go (Android) HOT 2
- I'm doing something wrong HOT 1
- The style focus doesn't work for LmInput in NextJs HOT 8
- Add helperTextProps to LmDatePicker HOT 4
- Show only one datepicker input when selecting a range. HOT 3
- LmDatepicker doesn't work on Android. HOT 4
- Button color variants HOT 2
- "RNDateTimePicker" cannot be found in UIManager HOT 5
- Sync over this project HOT 1
- Media/breakpoint specific styles HOT 5
- LmDatepicker OnChange never gets invoked in iOS ? HOT 1
- `Unable to resolve "expo-linear-gradient"` error when using <LmDateSelection/> HOT 8
- onChange doesn't get triggered for LmDatepicker on iOS and Android HOT 3
- InputRhf doesn't have error collor on label and helperText
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tamagui-kitchen-sink.