Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ pro-search] [偶现] 快捷面板下配置keywordFallback,一键清空,删除等操作后,输入关键字,默认选中的项不对 # #1749

Open
1 task
ljf52007 opened this issue Nov 27, 2023 · 0 comments

Comments

@ljf52007
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

playground.idux.site

Steps to reproduce

复现demo:

<template>
  <div style="padding: 24px">
    <IxProSearch
                 class="pull-right"
                 style="width: 80%"
                 :value.sync="filterValue"
                 :searchFields="searchFields"
                 overlay-container='pro-search-wrapper--loophole'>
    </IxProSearch>
  </div>
</template>
 

<script setup lang="ts">
  import {ref, computed} from 'vue'
 
const filterValue = ref<SearchValue[]>([]);
  const searchFields = computed<SearchField[]>(() => [
    {
        type: 'select',
        label: '终端类型',
        key: 'host_type',
        quickSelect: true,
        placeholder: '终端类型',
        fieldConfig: {
            multiple: false,
            searchable: true,
            dataSource: [
              { label: '全部', key: 1},
              { label: 'PC', key:0},
              { label: '服务器', key:3},
          ]
        }
    },
     {
        type: 'input',
        label: '关键字1',
        key: 'xixi',
       keywordFallback: true,
        placeholder: '终端类型',
    },
         {
        type: 'input',
        label: '关键字2',
        key: 'haha',
       keywordFallback: true,
        placeholder: '终端类型',
    },

]);
const searchKeys = computed(() => searchFields.value.map(i => i.key as string));
const filterFields = (fields: SearchField[], keys: string[]) => {
  return fields.filter(field => keys.includes(field.key as string))
}
</script>

复现步骤:

第一次输入关键字,回车;
一键清除;
第二次输入关键字,回车;

What is expected?

默认选中的应该还是第一项;

What is actually happening?

默认选中第二项;

Environment Info

Any additional comments? (optional)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant