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

Adds allowFontScaling to TextField and it's FloatingLabel #187

Merged
merged 1 commit into from
Jul 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/mdl/Textfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ class FloatingLabel extends Component {
<Animated.Text
ref="label"
pointerEvents="none"
allowFontScaling={this.props.allowFontScaling}

style={[{
backgroundColor: MKColor.Transparent,
position: 'absolute',
Expand Down Expand Up @@ -181,6 +183,9 @@ FloatingLabel.publicPropTypes = {
// [Font](MKPropTypes.html#font) of floating label
// FIXME causing warning: `typeChecker is not a function`
floatingLabelFont: MKPropTypes.font,

// Specifies should fonts scale to respect Text Size accessibility setting on iOS.
allowFontScaling: PropTypes.bool,
};

FloatingLabel.propTypes = {
Expand Down Expand Up @@ -505,6 +510,8 @@ class Textfield extends Component {
<FloatingLabel ref="floatingLabel"
{...props}
text={this.props.placeholder}
allowFontScaling={this.props.allowFontScaling}

/>
);
}
Expand Down Expand Up @@ -536,6 +543,7 @@ class Textfield extends Component {
onChangeText={this._onTextChange}
onFocus={this._onFocus}
onBlur={this._onBlur}
allowFontScaling={this.props.allowFontScaling}
/>
{floatingLabel}
<Underline ref="underline" // the underline
Expand Down Expand Up @@ -580,6 +588,9 @@ Textfield.propTypes = {

// Style applied to the `TextInput` component, ok to use `StyleSheet`
textInputStyle: PropTypes.any,

// Specifies should fonts scale to respect Text Size accessibility setting on iOS.
allowFontScaling: PropTypes.bool,
};

// ## <section id='defaults'>Defaults</section>
Expand Down