From 3621e0c60fc46bc05cdd0bb91b05ed8e1d77303e Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期四, 11 四月 2024 16:54:50 +0800
Subject: [PATCH] 1234
---
force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.js | 38 ++++++++++++++++++++++++++++----------
1 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.js b/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.js
index 924fc87..725a643 100644
--- a/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.js
+++ b/force-app/main/default/lwc/multiSelectCombobox/multiSelectCombobox.js
@@ -1,6 +1,7 @@
/* Code by CafeForce || www.cafeforce.com || support@cafeforce.com || Mandatory Header */
import { LightningElement, track, api } from 'lwc';
-
+import lexHandCss from '@salesforce/resourceUrl/lexHandCss';
+import {loadStyle} from 'lightning/platformResourceLoader';
export default class MultiSelectCombobox extends LightningElement {
@api options;
@@ -21,6 +22,9 @@
@api placeholder = '--鏃�--';
@track errorFlag = false;
connectedCallback() {
+ Promise.all([
+ loadStyle(this, lexHandCss)
+ ]);
this.showDropdown = false;
var optionData = this.options ? (JSON.parse(JSON.stringify(this.options))) : null;
var value = this.selectedValue ? (JSON.parse(JSON.stringify(this.selectedValue))) : null;
@@ -52,6 +56,15 @@
get isRequired() {
return this.required;
+ }
+ closeAction(){
+ this.showDropdown = false;
+ }
+ handlePayModeOpen() {
+ setTimeout(() => {
+ const topDiv = this.template.querySelector('[data-id="scrollSec"]');
+ topDiv.scrollTop = topDiv.scrollHeight;
+ }, 20);
}
filterOptions(event) {
@@ -113,7 +126,20 @@
event.preventDefault();
else
this.showDropdown = false;
+ this.dispatchEvent(new CustomEvent('select', {
+ detail: {
+ 'payloadType' : 'multi-select',
+ 'payload' : {
+ 'value' : this.value,
+ 'values' : this.values
+ }
+ }
+ }));
}
+ }
+
+ dontClose(event){
+ event.preventDefault();
}
showOptions() {
@@ -178,15 +204,7 @@
this.showDropdown = false;
- this.dispatchEvent(new CustomEvent('select', {
- detail: {
- 'payloadType' : 'multi-select',
- 'payload' : {
- 'value' : this.value,
- 'values' : this.values
- }
- }
- }));
+
}
}
/*
--
Gitblit v1.9.1