Skip to content

Commit

Permalink
added echoMode property to LineEdit (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
msairio authored and a7ul committed Nov 24, 2019
1 parent 5974b3e commit 465f353
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/LineEdit/RNLineEdit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QLineEdit, NodeWidget } from "@nodegui/nodegui";
import { QLineEdit, EchoMode, NodeWidget } from "@nodegui/nodegui";
import { ViewProps, setViewProps } from "../View/RNView";
import { RNWidget } from "../config";
import { throwUnsupported } from "../../utils/helpers";
Expand All @@ -7,6 +7,7 @@ export interface LineEditProps extends ViewProps {
text?: string;
placeholderText?: string;
readOnly?: boolean;
echoMode?: EchoMode;
}

const setLineEditProps = (
Expand All @@ -23,6 +24,9 @@ const setLineEditProps = (
},
set readOnly(isReadOnly: boolean) {
widget.setReadOnly(isReadOnly);
},
set echoMode(mode: EchoMode) {
widget.setEchoMode(mode);
}
};
Object.assign(setter, newProps);
Expand Down
13 changes: 13 additions & 0 deletions website/docs/api/interfaces/lineeditprops.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ sidebar_label: "LineEditProps"
### Properties

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

___

### `Optional` echoMode

**echoMode**? : *EchoMode*

Sets the property that determines how the text entered in the line edit is displayed (or echoed) to the user.

The widget's display and the ability to copy or drag the text is affected by this setting.

[QLineEdit: setEchoMode](https://docs.nodegui.org/docs/api/QLineEdit#lineeditsetechomode)

___

### `Optional` enabled

**enabled**? : *undefined | false | true*
Expand Down

0 comments on commit 465f353

Please sign in to comment.