input id must differ from all other ids
This commit is contained in:
parent
990935d07c
commit
10104b8494
2 changed files with 22 additions and 5 deletions
|
|
@ -201,10 +201,27 @@ export default {
|
|||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
|
||||
const data = evt.type === 'paste' ? (evt.clipboardData || window.clipboardData) : evt.dataTransfer;
|
||||
const value = data.getData('Text')?.trim();
|
||||
const input = document.getElementById(evt.srcElement.id);
|
||||
const originalValue = input.value;
|
||||
const startPosition = input.selectionStart;
|
||||
const endPosition = input.selectionEnd;
|
||||
const selectionLength = endPosition - startPosition;
|
||||
|
||||
this.$emit('update:modelValue', this.modelValue + value);
|
||||
let data = null;
|
||||
if (evt.type === 'paste') {
|
||||
data = evt.clipboardData || window.clipboardData;
|
||||
} else {
|
||||
data = evt.dataTransfer;
|
||||
}
|
||||
|
||||
const textValue = data.getData('Text');
|
||||
|
||||
// Insert the pasted/dropped string at the index position
|
||||
const arrOriginalString = originalValue.split('');
|
||||
arrOriginalString.splice(startPosition, selectionLength, textValue);
|
||||
const blendedString = arrOriginalString.join('');
|
||||
|
||||
this.$emit('update:modelValue', blendedString);
|
||||
},
|
||||
clickedSearch() {
|
||||
if (this.meta.valid) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<textboxQuestion
|
||||
id="tpaSearchQuestionField"
|
||||
v-model="zipCode"
|
||||
inputId="tpaSearchQuestionField"
|
||||
inputId="tpaSearchQuestionFieldInput"
|
||||
:cmsWidgetName="widget.tpaSearchQuestion"
|
||||
:includeSearchIcon="true"
|
||||
:displayQuestionText="false"
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
id="searchRadiusFilter"
|
||||
v-model="filter"
|
||||
:cmsWidgetName="widget.filterByQuestion"
|
||||
inputId="filterByQuestionField"
|
||||
inputId="searchRadiusFilterInput"
|
||||
:options="filterOptions"
|
||||
disableAutoFill
|
||||
:isDisabled="reloadingProviders"
|
||||
|
|
|
|||
Loading…
Reference in a new issue