Skip to content

Commit

Permalink
Remove the paste/ourPaste event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Aug 28, 2024
1 parent af5aadc commit 7e91a91
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions app/javascript/controllers/autocompleter_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ export default class extends Controller {
this.inputTarget.addEventListener("keyup", this);
this.inputTarget.addEventListener("keypress", this);
this.inputTarget.addEventListener("change", this);
this.inputTarget.addEventListener("paste", this);
// Turbo: check this. May need to be turbo.before_render or before_visit
window.addEventListener("beforeunload", this);
}
Expand Down Expand Up @@ -414,9 +413,6 @@ export default class extends Controller {
case "change":
this.ourChange(event);
break;
case "paste":
this.ourPaste(event);
break;
case "beforeunload":
this.ourUnload(event);
break;
Expand Down Expand Up @@ -516,27 +512,6 @@ export default class extends Controller {
}
}

// User pasted into text field.
// When matching multiple records, needs to keep track of "keepers", and
// update the hidden ids if the list of matches gets edited.
// Assess the pasted text and stop propagation (to change event).
ourPaste(event) {
// if (this.SEPARATOR) {
// event.stopPropagation();
// this.verbose("autocompleter:ourPaste()");
// const pasted = event.clipboardData.getData('text'),
// pasted_array = pasted.split(this.SEPARATOR).map(s => s.trim());
// this.addMissingKeepersAndIds(pasted_array);
// // this.ourChange(true);

// // Handle the fact this could be pasted in the middle of the input,
// // or in place of selected text
// const { text, start, end } = this.getActiveInputSelection();
// if (start !== null)
// this.inputTarget.setRangeText(text, start, end);
// }
}

// User clicked into text field.
ourClick(event) {
if (this.ACT_LIKE_SELECT)
Expand Down

0 comments on commit 7e91a91

Please sign in to comment.