Skip to content

Commit 697e145

Browse files
authored
Add textInteractionFlags to Text component (#237)
* add textInteractionFlags * add docs for textInteractionFlags * add link to flag enum
1 parent 623c1b9 commit 697e145

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/components/Text/RNText.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { QLabel, NodeWidget, QLabelSignals } from '@nodegui/nodegui';
1+
import { QLabel, NodeWidget, QLabelSignals, TextInteractionFlag } from '@nodegui/nodegui';
22
import { ViewProps, setViewProps } from '../View/RNView';
33
import { RNWidget } from '../config';
44
import { throwUnsupported } from '../../utils/helpers';
@@ -8,6 +8,7 @@ export interface TextProps extends ViewProps<QLabelSignals> {
88
wordWrap?: boolean;
99
scaledContents?: boolean;
1010
openExternalLinks?: boolean;
11+
textInteractionFlags?: TextInteractionFlag;
1112
}
1213

1314
/**
@@ -33,6 +34,9 @@ export const setTextProps = (
3334
set openExternalLinks(shouldOpenExternalLinks: boolean) {
3435
widget.setProperty('openExternalLinks', shouldOpenExternalLinks);
3536
},
37+
set textInteractionFlags(interactionFlag: TextInteractionFlag){
38+
widget.setProperty('textInteractionFlags', interactionFlag);
39+
}
3640
};
3741
Object.assign(setter, newProps);
3842
setViewProps(widget, newProps, oldProps);

website/docs/api/interfaces/textprops.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ sidebar_label: "TextProps"
3535
* [size](textprops.md#optional-size)
3636
* [style](textprops.md#optional-style)
3737
* [styleSheet](textprops.md#optional-stylesheet)
38+
* [textInteractionFlags](textprops.md#optional-textinteractionflags)
3839
* [visible](textprops.md#optional-visible)
3940
* [windowFlags](textprops.md#optional-windowflags)
4041
* [windowIcon](textprops.md#optional-windowicon)
@@ -204,6 +205,13 @@ Sets the property that holds the widget's style sheet. [QWidget: setStyleSheet](
204205

205206
___
206207

208+
### `Optional` textInteractionFlags
209+
210+
**textInteractionFlags**? : *undefined | [TextInteractionFlag](https://docs.nodegui.org/docs/api/generated/enums/textinteractionflag)*
211+
212+
Sets the widget's interaction flag
213+
___
214+
207215
### `Optional` visible
208216

209217
**visible**? : *undefined | false | true*

0 commit comments

Comments
 (0)