Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@github/text-expander-element

Package Overview
Dependencies
Maintainers
17
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/text-expander-element - npm Package Compare versions

Comparing version
2.9.2
to
2.9.4
+9
-2
dist/bundle.js

@@ -639,3 +639,4 @@ const ctrlBindings = !!navigator.userAgent.match(/Macintosh/);

positionMenu(menu, position) {
const caretRect = new InputRange(this.input, position).getBoundingClientRect();
const clampedPosition = Math.min(position, this.input.value.length);
const caretRect = new InputRange(this.input, clampedPosition).getBoundingClientRect();
const targetPosition = { left: caretRect.left, top: caretRect.top + caretRect.height };

@@ -713,2 +714,5 @@ const currentPosition = menu.getBoundingClientRect();

}
isMatchStillValid(match) {
return match.position <= this.input.value.length;
}
async onInput() {

@@ -723,4 +727,7 @@ if (this.justPasted) {

const menu = await this.notifyProviders(match);
if (!this.match)
if (!this.match || !this.isMatchStillValid(match)) {
this.match = null;
this.deactivate();
return;
}
if (menu) {

@@ -727,0 +734,0 @@ this.activate(match, menu);

@@ -469,3 +469,4 @@ import Combobox from '@github/combobox-nav';

positionMenu(menu, position) {
const caretRect = new InputRange(this.input, position).getBoundingClientRect();
const clampedPosition = Math.min(position, this.input.value.length);
const caretRect = new InputRange(this.input, clampedPosition).getBoundingClientRect();
const targetPosition = { left: caretRect.left, top: caretRect.top + caretRect.height };

@@ -543,2 +544,5 @@ const currentPosition = menu.getBoundingClientRect();

}
isMatchStillValid(match) {
return match.position <= this.input.value.length;
}
async onInput() {

@@ -553,4 +557,7 @@ if (this.justPasted) {

const menu = await this.notifyProviders(match);
if (!this.match)
if (!this.match || !this.isMatchStillValid(match)) {
this.match = null;
this.deactivate();
return;
}
if (menu) {

@@ -557,0 +564,0 @@ this.activate(match, menu);

@@ -56,3 +56,4 @@ import Combobox from '@github/combobox-nav';

positionMenu(menu, position) {
const caretRect = new InputRange(this.input, position).getBoundingClientRect();
const clampedPosition = Math.min(position, this.input.value.length);
const caretRect = new InputRange(this.input, clampedPosition).getBoundingClientRect();
const targetPosition = { left: caretRect.left, top: caretRect.top + caretRect.height };

@@ -130,2 +131,5 @@ const currentPosition = menu.getBoundingClientRect();

}
isMatchStillValid(match) {
return match.position <= this.input.value.length;
}
async onInput() {

@@ -140,4 +144,7 @@ if (this.justPasted) {

const menu = await this.notifyProviders(match);
if (!this.match)
if (!this.match || !this.isMatchStillValid(match)) {
this.match = null;
this.deactivate();
return;
}
if (menu) {

@@ -144,0 +151,0 @@ this.activate(match, menu);

+1
-1
{
"name": "@github/text-expander-element",
"version": "2.9.2",
"version": "2.9.4",
"description": "Activates a suggestion menu to expand text snippets as you type.",

@@ -5,0 +5,0 @@ "repository": "github/text-expander-element",