@textcomplete/core
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -14,2 +14,3 @@ import { EventEmitter } from "eventemitter3"; | ||
parent?: HTMLElement; | ||
dynamicWidth?: boolean; | ||
} | ||
@@ -16,0 +17,0 @@ interface DropdownItemOption { |
@@ -167,3 +167,5 @@ "use strict"; | ||
if (cursorOffset.left) { | ||
const browserWidth = doc.clientWidth; | ||
const browserWidth = this.option.dynamicWidth | ||
? doc.scrollWidth | ||
: doc.clientWidth; | ||
if (cursorOffset.left + elementWidth > browserWidth) { | ||
@@ -170,0 +172,0 @@ cursorOffset.left = browserWidth - elementWidth; |
{ | ||
"name": "@textcomplete/core", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Textcomplete core.", | ||
@@ -40,3 +40,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "81c7b759d938d484e4176e5a001c68d9168d09e5" | ||
"gitHead": "03b7bee368cea9812a3c4cf8403ea24c84ed9a0f" | ||
} |
@@ -17,2 +17,3 @@ import { EventEmitter } from "eventemitter3" | ||
parent?: HTMLElement | ||
dynamicWidth?: boolean | ||
} | ||
@@ -208,3 +209,5 @@ | ||
if (cursorOffset.left) { | ||
const browserWidth = doc.clientWidth | ||
const browserWidth = this.option.dynamicWidth | ||
? doc.scrollWidth | ||
: doc.clientWidth | ||
if (cursorOffset.left + elementWidth > browserWidth) { | ||
@@ -211,0 +214,0 @@ cursorOffset.left = browserWidth - elementWidth |
Sorry, the diff of this file is not supported yet
84010
1850