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

SDK模式下,select使用自定义过滤,采用移动模式,下拉点不开 #9725

Closed
zwjsoft opened this issue Mar 4, 2024 · 1 comment · Fixed by #9905
Closed
Assignees
Labels
confirmed feat style Bug or PR related to component's style

Comments

@zwjsoft
Copy link

zwjsoft commented Mar 4, 2024

描述问题:

SDK模式下,select使用自定义过滤filterOption,采用移动模式isMoble:function(){return true},下拉点不开,同样的schema在react环境下没问题,不适用移动模式也没问题

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    sdk

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.1

  3. 粘贴有问题的完整 amis schema 代码:

<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <title>amis demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1"
    />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <link
      rel="stylesheet"
      title="default"
      href="sdk/sdk.css"
    />
    <link rel="stylesheet" href="sdk/helper.css" />
    <link
      rel="stylesheet"
      href="sdk/iconfont.css"
    />
    <script src="sdk/sdk.js"></script>
    <style>
      html,
      body,
      .app-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="root" class="app-wrapper"></div>

    <script type="text/javascript">
      (function () {
        let amis = amisRequire('amis/embed');
        // 通过替换下面这个配置来生成不同页面
        let amisJSON = {
  "type": "page",
  "body": [
    {
      "type": "form",
      "api": "/amis/api/mock2/form/saveForm",
      "body": [
        {
          "label": "带搜索",
          "type": "select",
          "name": "a",
          "selectMode": "chained",
          "searchable": true,
          "filterOption": "return options.filter(({value, label, weapon}) => value?.includes(inputValue) || label?.includes(inputValue) || weapon?.includes(inputValue));",
          "sortable": true,
          "multiple": true,
          "options": [
            {
              "label": "诸葛亮",
              "value": "zhugeliang",
              "weapon": "翡翠仙扇"
            },
            {
              "label": "曹操",
              "value": "caocao",
              "weapon": "幻影双刃"
            },
            {
              "label": "钟无艳",
              "value": "zhongwuyan",
              "weapon": "破岳震天锤"
            },
            {
              "label": "李白",
              "value": "libai",
              "weapon": "青丝缠月剑"
            },
            {
              "label": "韩信",
              "value": "hanxin",
              "weapon": "龙吟穿云枪"
            },
            {
              "label": "云中君",
              "value": "yunzhongjun",
              "weapon": "飘渺云影剑"
            }
          ],
          "id": "u:e4cecdba0576"
        }
      ],
      "id": "u:e7b1b69954c9",
      "actions": [
        {
          "type": "submit",
          "label": "提交",
          "primary": true,
          "id": "u:4974872b257a"
        }
      ],
      "feat": "Insert"
    }
  ],
  "id": "u:b181cd6621f9"
};
        let amisScoped = amis.embed('#root', amisJSON,{},{isMobile:function(){return true}});
      })();
    </script>
  </body>
</html>
  1. 操作步骤
    请简单描述一下复现的操作步骤...
@github-actions github-actions bot added feat style Bug or PR related to component's style labels Mar 4, 2024
Copy link

github-actions bot commented Mar 4, 2024

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed feat style Bug or PR related to component's style
Projects
None yet
3 participants