Skip to content

Commit be07c02

Browse files
committed
keep the text value as initialText
1 parent 705f4ff commit be07c02

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/browser-repl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Shell is a React component with the following properties:
4040
- `maxOutputLength?: number`: The maxiumum number of lines to keep in the output. Defaults to `1000`.
4141
- `maxHistoryLength?: number`: The maxiumum number of lines to keep in the history. Defaults to `1000`.
4242
- `initialEvaluate?: string|string[]`: A set of input strings to evaluate right after shell is mounted.
43-
- `inputText?: string`: The text for the input field.
43+
- `initialText?: string`: The initial text for the input field.
4444
- `output?: ShellOutputEntry[]`: An array of entries to be displayed in the output area. Can be used to restore the output between sessions, or to setup a greeting message. **Note**: new entries will not be appended to the array.
4545
- `history?: readonly string[]`: An array of history entries to prepopulate the history.
4646
Can be used to restore the history between sessions. Entries must be ordered from the most recent to the oldest. Note: new entries will not be appended to the array.

packages/browser-repl/src/components/shell.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ describe('shell', function () {
160160
expect(filterEvaluateCalls(fakeRuntime.evaluate.args)).to.have.length(1);
161161
});
162162

163-
it('takes inputText', function () {
164-
const inputText = 'still typing';
163+
it('takes initialText', function () {
164+
const initialText = 'still typing';
165165

166-
render(<ShellWrapper runtime={fakeRuntime} inputText={inputText} />);
167-
expect(screen.getByRole('textbox').textContent).to.equal(inputText);
166+
render(<ShellWrapper runtime={fakeRuntime} initialText={initialText} />);
167+
expect(screen.getByRole('textbox').textContent).to.equal(initialText);
168168
expect(filterEvaluateCalls(fakeRuntime.evaluate.args)).to.be.empty;
169169
});
170170

packages/browser-repl/src/components/shell.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ interface ShellProps {
112112
/**
113113
* Initial value in the shell input field
114114
*/
115-
inputText?: string;
115+
initialText?: string;
116116

117117
/* An array of entries to be displayed in the output area.
118118
*
@@ -184,7 +184,7 @@ export const Shell = ({
184184
onOperationStarted,
185185
onOperationEnd,
186186
initialEvaluate,
187-
inputText,
187+
initialText,
188188
output,
189189
history,
190190
isOperationInProgress = false,
@@ -451,7 +451,7 @@ export const Shell = ({
451451
/>
452452
) : (
453453
<ShellInput
454-
initialText={inputText}
454+
initialText={initialText}
455455
onTextChange={onInputChanged}
456456
prompt={shellPrompt}
457457
autocompleter={runtime}

0 commit comments

Comments
 (0)