【问题标题】:Removing arrow in ui-select box删除 ui-select 框中的箭头
【发布时间】:2017-12-09 07:29:11
【问题描述】:

在我的 AngularJS 应用程序中,我想从 ui-select 框中删除默认箭头。

      <ui-select
        class="ui-select-no-arrow"
        ng-model="$ctrl.workoutHours"
        ng-change="$ctrl.updateHours($ctrl.workoutHours)"
        input-type="number"
        style="width: 3.5em"
        theme="bootstrap"> 
        <ui-select-match>{{ $ctrl.workoutHours }}</ui-select-match>
        <ui-select-choices
          repeat="hour in $ctrl.getHours($select.search) | filter: $select.search">
          {{ hour }}
        </ui-select-choices>
      </ui-select>

根据 Stack Overflow 上类似问题的回答,我尝试了以下方法:

.ui-select-no-arrow {
  -webkit-appearance: none;
  -moz-appearance: none;
  text-indent: 1px;
  text-overflow: '';
}

同时更新 ui-select 元素上的类。这根本没有做任何事情,但如果我更改为并执行以下 CSS:

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  text-indent: 1px;
  text-overflow: '';
}

这确实摆脱了箭头。无论如何,至少在 Chrome 和 Firefox 中是这样。

我需要做什么才能摆脱箭头而不是仅仅?

【问题讨论】:

    标签: css angularjs ui-select


    【解决方案1】:

    很简单:)

    .caret {
      display: none;
    }
    

    【讨论】:

    • @user3143105 随时!我真的会推荐学习/挖掘开发人员工具。它真的很强大,让你调试过程更容易:)
    猜你喜欢
    • 2012-06-07
    • 2018-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-24
    • 2018-11-22
    • 1970-01-01
    • 2018-12-25
    相关资源
    最近更新 更多