Skip to content

Commit

Permalink
Merge pull request #55 from github/use-dom-input-range
Browse files Browse the repository at this point in the history
Use `dom-input-range` instead of internal implementation
  • Loading branch information
iansan5653 committed May 15, 2024
2 parents eee5f70 + 8824151 commit 8245b85
Show file tree
Hide file tree
Showing 10 changed files with 2,162 additions and 1,314 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": { "VARIANT": "16" }
"args": { "VARIANT": "20" }
},

// Set *default* container specific settings.json values on container create.
Expand Down
3,203 changes: 2,148 additions & 1,055 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
],
"prettier": "@github/prettier-config",
"dependencies": {
"@github/combobox-nav": "^2.0.2"
"@github/combobox-nav": "^2.0.2",
"dom-input-range": "^1.1.3"
},
"devDependencies": {
"@github/prettier-config": "0.0.4",
"chai": "^4.3.4",
"chromium": "^3.0.3",
"eslint": "^7.24.0",
"eslint-plugin-github": "^4.1.3",
"eslint": "^8.0.1",
"eslint-plugin-github": "^4.10.2",
"karma": "^6.3.2",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
Expand All @@ -45,7 +46,7 @@
"mocha": "^8.3.2",
"rollup": "^2.45.1",
"rollup-plugin-node-resolve": "^5.2.0",
"typescript": "^4.2.4"
"typescript": "^5.4.5"
},
"eslintIgnore": [
"build/",
Expand Down
4 changes: 2 additions & 2 deletions src/text-expander-element.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Combobox from '@github/combobox-nav'
import query from './query'
import textFieldSelectionPosition from './text-field-selection-position'
import {InputRange} from 'dom-input-range'

type Match = {
text: string
Expand Down Expand Up @@ -103,7 +103,7 @@ class TextExpander {

this.expander.dispatchEvent(new Event('text-expander-activate'))

let {top, left} = textFieldSelectionPosition(this.input, match.position)
let {top, left} = new InputRange(this.input, match.position).getBoundingClientRect()
if (isTopLayer(menu)) {
const rect = this.input.getBoundingClientRect()
top += rect.top
Expand Down
115 changes: 0 additions & 115 deletions src/text-field-mirror.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/text-field-selection-position.ts

This file was deleted.

6 changes: 6 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
},
"globals": {
"assert": true
},
"rules": {
"github/no-inner-html": "off",
"filenames/match-regex": "off",
// Linting currently runs as a pre-build step, so the dependent files may not exist yet by the time linting is run
"import/no-unresolved": "off"
}
}
2 changes: 0 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import './query-test'
import './text-expander-element-test'
import './text-field-mirror-test'
import './textarea-contents-height-test'
47 changes: 0 additions & 47 deletions test/text-field-mirror-test.js

This file was deleted.

56 changes: 0 additions & 56 deletions test/textarea-contents-height-test.js

This file was deleted.

0 comments on commit 8245b85

Please sign in to comment.