mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #2450 from Tyriar/1158_throw_bad_open
Throw when open is called on element not on DOM
This commit is contained in:
@@ -56,6 +56,9 @@ export class Terminal implements ITerminalApi {
|
||||
this._core.resize(columns, rows);
|
||||
}
|
||||
public open(parent: HTMLElement): void {
|
||||
if (!document.body.contains(parent)) {
|
||||
throw new Error('open must be called on an element that is attached to the DOM');
|
||||
}
|
||||
this._core.open(parent);
|
||||
}
|
||||
public attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void {
|
||||
|
||||
Reference in New Issue
Block a user