Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
03992b7
[package] Bump to currently published v0.62.1
alloy Sep 2, 2020
85acf4c
Applying package update to 0.62.2 ***NO_CI***
rnbot Sep 2, 2020
033d97a
Applying package update to 0.62.3 ***NO_CI***
rnbot Sep 3, 2020
b34fadc
Applying package update to 0.62.4 ***NO_CI***
rnbot Sep 3, 2020
3c22002
Applying package update to 0.62.5 ***NO_CI***
rnbot Sep 4, 2020
164d73b
Applying package update to 0.62.6 ***NO_CI***
rnbot Sep 8, 2020
e4e3c0f
Applying package update to 0.62.7 ***NO_CI***
rnbot Sep 8, 2020
c94519b
Applying package update to 0.62.8 ***NO_CI***
rnbot Sep 10, 2020
843ccf0
Applying package update to 0.62.9 ***NO_CI***
rnbot Sep 10, 2020
ae16d6e
Applying package update to 0.62.10 ***NO_CI***
rnbot Sep 11, 2020
c6420e7
Applying package update to 0.62.11 ***NO_CI***
rnbot Sep 15, 2020
c5047ce
Applying package update to 0.62.12 ***NO_CI***
rnbot Sep 16, 2020
ba43807
Applying package update to 0.62.13 ***NO_CI***
rnbot Sep 21, 2020
9b31500
Applying package update to 0.62.14 ***NO_CI***
rnbot Sep 24, 2020
469597a
Applying package update to 0.62.15 ***NO_CI***
rnbot Sep 28, 2020
be9bd9b
Applying package update to 0.62.16 ***NO_CI***
rnbot Oct 7, 2020
34672cb
Applying package update to 0.62.17 ***NO_CI***
rnbot Dec 4, 2020
761c701
Applying package update to 0.62.18 ***NO_CI***
rnbot Dec 4, 2020
d4737a7
Applying package update to 0.62.19 ***NO_CI***
rnbot Dec 4, 2020
71f6447
Applying package update to 0.62.20 ***NO_CI***
rnbot Dec 17, 2020
0be3b60
Applying package update to 0.62.21 ***NO_CI***
rnbot Dec 17, 2020
2467163
Ensuring that the same version of folly is built as well as packaged …
mganandraj Jan 16, 2021
b7fc708
Applying package update to 0.62.22 ***NO_CI***
rnbot Jan 16, 2021
2c967a8
Add tooltip support
chiuam Jan 27, 2021
b48cee5
add tooltip support for <Image>
chiuam Jan 27, 2021
2fd7d42
add test case for <View>
chiuam Jan 27, 2021
039ef82
fix merge changes
chiuam Jan 28, 2021
68160df
add tooltip support to <slider>
chiuam Jan 28, 2021
188e13c
add tooltip support to <TextInput>
chiuam Jan 28, 2021
1b86979
fix CI errors
chiuam Jan 29, 2021
e18dc09
fix prettier errors
chiuam Jan 29, 2021
6a2fd63
fix more prettier errors
chiuam Jan 29, 2021
6e53a76
add missing file
chiuam Jan 29, 2021
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
6 changes: 6 additions & 0 deletions Libraries/Components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ type ButtonProps = $ReadOnly<{|
* For arrow keys, add "leftArrow", "rightArrow", "upArrow", "downArrow",
*/
validKeysUp?: ?Array<string>,
/*
* Specifies the Tooltip for the view
*/
tooltip?: string,
// ]TODO(OSS Candidate ISS#2710739)
|}>;

Expand Down Expand Up @@ -211,6 +215,7 @@ class Button extends React.Component<ButtonProps> {
validKeysDown,
validKeysUp,
onKeyUp,
tooltip,
} = this.props;
const buttonStyles = [styles.button];
const textStyles = [styles.text];
Expand Down Expand Up @@ -261,6 +266,7 @@ class Button extends React.Component<ButtonProps> {
onKeyUp={onKeyUp}
validKeysDown={validKeysDown}
validKeysUp={validKeysUp}
tooltip={tooltip}
touchSoundDisabled={touchSoundDisabled}>
<View style={buttonStyles}>
<Text style={textStyles} disabled={disabled}>
Expand Down
4 changes: 4 additions & 0 deletions Libraries/Components/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ type Props = $ReadOnly<{|
* Used to locate this view in UI automation tests.
*/
testID?: ?string,
/**
* Specifies the tooltip.
*/
tooltip?: ?string,
|}>;

/**
Expand Down
4 changes: 4 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,10 @@ export type Props = $ReadOnly<{|
forwardedRef?: ?ReactRefSetter<
React.ElementRef<HostComponent<mixed>> & ImperativeMethods,
>,
/*
* Specifies the tooltip.
*/
tooltip?: ?string,
|}>;

type ImperativeMethods = $ReadOnly<{|
Expand Down
5 changes: 5 additions & 0 deletions Libraries/Image/ImageProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,9 @@ export type ImageProps = {|

src?: empty,
children?: empty,

/**
* Specifies the Tooltip for the view
*/
tooltip?: ?string,
|};
1 change: 1 addition & 0 deletions Libraries/Text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const viewConfig = {
onTextLayout: true,
onInlineViewLayout: true,
dataDetectorType: true,
tooltip: true,
},
directEventTypes: {
topTextLayout: {
Expand Down
9 changes: 9 additions & 0 deletions Libraries/Text/TextProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,13 @@ export type TextProps = $ReadOnly<{|
* See https://reactnative.dev/docs/text.html#supperhighlighting
*/
suppressHighlighting?: ?boolean,

/**
* macOS Only
*/

/**
* Specifies the Tooltip for the button view
*/
tooltip?: ?string,
|}>;
120 changes: 120 additions & 0 deletions RNTester/js/examples/Tooltip/TooltipExample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/

'use strict';

const React = require('react');
const {
Button,
Image,
Slider,
StyleSheet,
Text,
TextInput,
View,
} = require('react-native');

const styles = StyleSheet.create({
image: {
width: 38,
height: 38,
},
textInput: {
borderWidth: StyleSheet.hairlineWidth,
borderColor: '#0f0f0f',
flex: 1,
fontSize: 13,
padding: 4,
},
view: {
backgroundColor: '#3CE8DA',
padding: 10,
},
});

const image = {
uri: 'https://www.facebook.com/favicon.ico',
};

function SliderExample(props: React.ElementConfig<typeof Slider>) {
const [value, setValue] = React.useState(0);

return (
<View>
<Text>{value.toFixed(3)}</Text>
<Slider
{...props}
onValueChange={newValue => setValue(newValue)}
tooltip={value.toFixed(3)}
/>
</View>
);
}

exports.displayName = 'TooltipExample';
exports.framework = 'React';
exports.title = 'Tooltip';
exports.description = 'Examples that showcase tooltip in various components.';

exports.examples = [
{
title: 'Button',
description: ('Simple button to showcase tooltip.': string),
render: function(): React.Node {
return (
<Button
title="Hover me"
onPress={() => {}}
tooltip={'Button tooltip'}
/>
);
},
},
{
title: 'Text',
description: ('Simple text string to showcase tooltip.': string),
render: function(): React.Node {
return (
<Text tooltip={'Text tooltip'}>
Simple text string to showcase tooltip.
</Text>
);
},
},
{
title: 'Image',
description: ('Image to showcase tooltip.': string),
render: function(): React.Node {
return (
<Image source={image} style={styles.image} tooltip={'Facebook logo'} />
);
},
},
{
title: 'View',
description: ('Background color view to showcase tooltip.': string),
render: function(): React.Node {
return <View style={styles.view} tooltip={'Turquoise'} />;
},
},
{
title: 'Slider',
description: ('Tooltip displays the current value.': string),
render(): React.Element<any> {
return <SliderExample />;
},
},
{
title: 'TextInput',
render: function(): React.Node {
return <TextInput style={styles.textInput} tooltip={'Name'} />;
},
},
];
5 changes: 5 additions & 0 deletions RNTester/js/utils/RNTesterList.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ const ComponentExamples: Array<RNTesterExample> = [
module: require('../examples/TextInput/TextInputExample.ios'),
supportsTVOS: true,
},
{
key: 'TooltipExample',
module: require('../examples/Tooltip/TooltipExample'),
supportsTVOS: true,
},
{
key: 'TouchableExample',
module: require('../examples/Touchable/TouchableExample'),
Expand Down