-
Notifications
You must be signed in to change notification settings - Fork 3k
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: App changes positions of Ui elements when phone language RTL #7594
Merged
Merged
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
35d03d1
android force ltr
ahmdshrif f629028
ios force LTR
ahmdshrif b9dfc5d
fix ios text textAlign
ahmdshrif 993df41
apply PR suggestion
ahmdshrif 91f354b
fix / android need more config .
ahmdshrif c076468
fix lint
ahmdshrif f22a41f
Update TextInputLabelPropTypes.js
ahmdshrif 4982067
apply ios fix to all platform
ahmdshrif 8b63995
move rlt to setup file .
ahmdshrif 97b7533
fix picker textAlign in rtl
ahmdshrif e221c09
add textAlign to textinput as default props..
ahmdshrif 7ad6a02
linting
ahmdshrif 5bcb05c
Update src/setup/index.js
ahmdshrif 2912d63
apply text align form compnent
ahmdshrif b187fb7
update comment
ahmdshrif c23af67
create basetextinut
ahmdshrif b773963
add forward ref .
ahmdshrif 982279d
delete white space
ahmdshrif 59bdf0d
apply pr suggestion.
ahmdshrif ac689ca
rename BaseTextInput to BaseInput
ahmdshrif b249744
rename to BaseInput
ahmdshrif 268933c
convert to function component
ahmdshrif 6ab3113
linting
ahmdshrif 60d020c
Update src/components/BaseInput/index.js
ahmdshrif 23fc4a1
use underscore insted of typeof
ahmdshrif a81e2ea
rename baseinput to RNTextInput
ahmdshrif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { | ||
// eslint-disable-next-line no-restricted-imports | ||
TextInput as RNTextInput, | ||
} from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const propTypes = { | ||
/** A ref to forward to the text input */ | ||
forwardedRef: PropTypes.func, | ||
}; | ||
|
||
const defaultProps = { | ||
forwardedRef: () => {}, | ||
}; | ||
|
||
const BaseInput = props => ( | ||
<RNTextInput | ||
ref={(ref) => { | ||
if (typeof props.forwardedRef !== 'function') { | ||
ahmdshrif marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return; | ||
} | ||
props.forwardedRef(ref); | ||
}} | ||
|
||
// By default, align input to the left to override right alignment in RTL mode which is not yet supported in the App. | ||
// eslint-disable-next-line react/jsx-props-no-multi-spaces | ||
textAlign="left" | ||
|
||
// eslint-disable-next-line | ||
{...props} | ||
/> | ||
); | ||
|
||
BaseInput.propTypes = propTypes; | ||
BaseInput.defaultProps = defaultProps; | ||
ahmdshrif marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export default React.forwardRef((props, ref) => ( | ||
/* eslint-disable-next-line react/jsx-props-no-spreading */ | ||
<BaseInput {...props} forwardedRef={ref} /> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry I hate to do this, but
BaseInput
is a pretty generic name andBaseTextInput
is already taken... can we call thisRNTextInput.js
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok done. thanks .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience here 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. 😃