Git Product home page Git Product logo

Comments (6)

errorrik avatar errorrik commented on June 24, 2024

控件是否加hover、active、press、focus这些state由控件自己决定,仅样式上的变化的话,通过CSS处理,不通过鼠标事件管这事。
一定要有:hover、:active、:focus这几个伪类,样式通过这些伪类实现,不去使用这几个state相关的class。通过鼠标事件修改的class通常只能管理鼠标操作的情况,键盘操作不能覆盖,远没有伪类来得正确。

没理解这个

from esui.

otakustay avatar otakustay commented on June 24, 2024
  1. initMouseBehaviors虽然提供,但不强制要求所有InputControl子类一定调用。
  2. 如果在鼠标悬浮、按下的时候,仅仅样式产生变化,则要求写.ui-xxx:hover而不是.ui-xxx-hover,使用伪类解决问题。
  3. 事实上initMouseBehaviors产生的事件,在某些极端情况下没有伪类精准,比如“浏览器不在激活状态下元素移动过鼠标时某些版本的浏览器不触发mouseenter事件但会触发:hover伪类”。

from esui.

errorrik avatar errorrik commented on June 24, 2024

那,ui-xxx-hover有没有可能干掉,在Control层面?

from esui.

otakustay avatar otakustay commented on June 24, 2024

现在是有个initMouseBehavior方法的,我觉得这个方法留着,且从helper暴露出来,但是多数控件是不需要使用的,有需要的时候借用一下就好

from esui.

errorrik avatar errorrik commented on June 24, 2024

好吧,我再考虑考虑。未来,hover、press这种mouse相关的状态,我觉得都可以考虑不要了。

from esui.

otakustay avatar otakustay commented on June 24, 2024

已经在 808d8be 中移除了默认的鼠标交互,由CSS去实现,如果要js提供功能则则通过patch来做

from esui.

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.