Code Monkey home page Code Monkey logo

Comments (1)

topazur avatar topazur commented on August 16, 2024
/* 仅有一个 span 时不隐藏(其实是 mergedAllowClear 等于 false, 即不显示 clear 图标)。但是限制了插入的节点不能span */
.ant-select:hover > span:only-of-type {
  opacity: 1 !important;
}

虽然这样也可以覆盖样式,但是限制了插入的节点不能是 span,或者后续该组件内部添加了额外的 span 节点,就不适用了。

如果可以添加这个样式的话,就不用通过 has、:not(:last-child)、:only-of-type 等局限性的 api 来实现了
https://github.com/ant-design/ant-design/blob/8890eff05e0cb7596a702c51e658682e1757fc67/components/select/style/index.ts#L184

from select.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.