1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

Ctrl+click in select moves the cursor in modern browsers

This commit is contained in:
Jakub Vrana
2025-03-21 23:10:44 +01:00
parent f7b20b5f6f
commit 711f41d05b
2 changed files with 2 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
## Adminer dev
- Confirm before exiting edited edit form
- Display collation at table structure if different from table
- Ctrl+click in select moves the cursor in modern browsers
- PostgreSQL: Display auto_increment of inserted rows
- PostgreSQL: Display description of system variables
- PostgreSQL: Avoid warning about crdb_version (bug #924, regression from 5.0.5)

View File

@@ -715,7 +715,7 @@ function selectClick(event, text, warning) {
}
};
let pos = event.rangeOffset;
const pos = getSelection().anchorOffset;
let value = (td.firstChild && td.firstChild.alt) || td.textContent || td.innerText;
const tdStyle = window.getComputedStyle(td, null);
@@ -731,14 +731,6 @@ function selectClick(event, text, warning) {
if (qsa('i', td).length) { // <i> - NULL
value = '';
}
if (document.selection) {
const range = document.selection.createRange();
range.moveToPoint(event.clientX, event.clientY);
const range2 = range.duplicate();
range2.moveToElementText(td);
range2.setEndPoint('EndToEnd', range);
pos = range2.text.length;
}
td.innerHTML = '';
td.appendChild(input);
setupSubmitHighlight(td);
@@ -755,11 +747,6 @@ function selectClick(event, text, warning) {
input.name = td.id;
input.selectionStart = pos;
input.selectionEnd = pos;
if (document.selection) {
const range = document.selection.createRange();
range.moveEnd('character', -input.value.length + pos);
range.select();
}
return true;
}