Skip to content

Commit 465f353

Browse files
msairioa7ul
authored andcommitted
added echoMode property to LineEdit (#68)
1 parent 5974b3e commit 465f353

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/components/LineEdit/RNLineEdit.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { QLineEdit, NodeWidget } from "@nodegui/nodegui";
1+
import { QLineEdit, EchoMode, NodeWidget } from "@nodegui/nodegui";
22
import { ViewProps, setViewProps } from "../View/RNView";
33
import { RNWidget } from "../config";
44
import { throwUnsupported } from "../../utils/helpers";
@@ -7,6 +7,7 @@ export interface LineEditProps extends ViewProps {
77
text?: string;
88
placeholderText?: string;
99
readOnly?: boolean;
10+
echoMode?: EchoMode;
1011
}
1112

1213
const setLineEditProps = (
@@ -23,6 +24,9 @@ const setLineEditProps = (
2324
},
2425
set readOnly(isReadOnly: boolean) {
2526
widget.setReadOnly(isReadOnly);
27+
},
28+
set echoMode(mode: EchoMode) {
29+
widget.setEchoMode(mode);
2630
}
2731
};
2832
Object.assign(setter, newProps);

website/docs/api/interfaces/lineeditprops.md

+13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ sidebar_label: "LineEditProps"
1515
### Properties
1616

1717
* [cursor](lineeditprops.md#optional-cursor)
18+
* [echoMode](lineeditprops.md#optional-echoMode)
1819
* [enabled](lineeditprops.md#optional-enabled)
1920
* [geometry](lineeditprops.md#optional-geometry)
2021
* [id](lineeditprops.md#optional-id)
@@ -48,6 +49,18 @@ Sets the window mouse cursor. [QWidget: setCursor](https://docs.nodegui.org/docs
4849

4950
___
5051

52+
### `Optional` echoMode
53+
54+
**echoMode**? : *EchoMode*
55+
56+
Sets the property that determines how the text entered in the line edit is displayed (or echoed) to the user.
57+
58+
The widget's display and the ability to copy or drag the text is affected by this setting.
59+
60+
[QLineEdit: setEchoMode](https://docs.nodegui.org/docs/api/QLineEdit#lineeditsetechomode)
61+
62+
___
63+
5164
### `Optional` enabled
5265

5366
**enabled**? : *undefined | false | true*

0 commit comments

Comments
 (0)