diff --git a/packages/browser-repl/README.md b/packages/browser-repl/README.md index e5594e251..0203ef7c8 100644 --- a/packages/browser-repl/README.md +++ b/packages/browser-repl/README.md @@ -40,7 +40,7 @@ Shell is a React component with the following properties: - `maxOutputLength?: number`: The maxiumum number of lines to keep in the output. Defaults to `1000`. - `maxHistoryLength?: number`: The maxiumum number of lines to keep in the history. Defaults to `1000`. - `initialEvaluate?: string|string[]`: A set of input strings to evaluate right after shell is mounted. -- `inputText?: string`: The text for the input field. +- `initialText?: string`: The initial text for the input field. - `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. - `history?: readonly string[]`: An array of history entries to prepopulate the history. 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. diff --git a/packages/browser-repl/src/components/shell.spec.tsx b/packages/browser-repl/src/components/shell.spec.tsx index b734a644a..b9d6d551d 100644 --- a/packages/browser-repl/src/components/shell.spec.tsx +++ b/packages/browser-repl/src/components/shell.spec.tsx @@ -160,11 +160,11 @@ describe('shell', function () { expect(filterEvaluateCalls(fakeRuntime.evaluate.args)).to.have.length(1); }); - it('takes inputText', function () { - const inputText = 'still typing'; + it('takes initialText', function () { + const initialText = 'still typing'; - render(); - expect(screen.getByRole('textbox').textContent).to.equal(inputText); + render(); + expect(screen.getByRole('textbox').textContent).to.equal(initialText); expect(filterEvaluateCalls(fakeRuntime.evaluate.args)).to.be.empty; }); diff --git a/packages/browser-repl/src/components/shell.tsx b/packages/browser-repl/src/components/shell.tsx index af015f119..89cefd2c4 100644 --- a/packages/browser-repl/src/components/shell.tsx +++ b/packages/browser-repl/src/components/shell.tsx @@ -112,7 +112,7 @@ interface ShellProps { /** * Initial value in the shell input field */ - inputText?: string; + initialText?: string; /* An array of entries to be displayed in the output area. * @@ -184,7 +184,7 @@ export const Shell = ({ onOperationStarted, onOperationEnd, initialEvaluate, - inputText, + initialText, output, history, isOperationInProgress = false, @@ -451,7 +451,7 @@ export const Shell = ({ /> ) : (