Giter VIP home page Giter VIP logo

Comments (6)

MaximBalaganskiy avatar MaximBalaganskiy commented on May 24, 2024

The issue is that select emits blur when a dropdown receives focus. Not sure if this can be prevented, I'll have a look

from aurelia-mdc-web.

arjendeblok avatar arjendeblok commented on May 24, 2024

If I move the blur emit this.emit('blur', {}, true); from MdcSelect.handleBlur to MdcSelect.handleMenuClosed then it works as expected.

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on May 24, 2024

If you do that then just tabbing through the select will not validate it.

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on May 24, 2024

I can do

handleBlur() {
  this.foundation?.handleBlur();
  if (!this.root.classList.contains(cssClasses.ACTIVATED)) {
    this.emit('blur', {}, true);
  }
}

This will prevent validation when the menu is open. But if a user tabs out of this open menu the control will not be validated since the select itself is not getting the focus back. This can be solved, as you suggested, by emitting blur on menu close, but, if the menu was closed by clicking on the select itself it will trigger validation even though focus is "conceptually" is still on the select. What are your thoughts?

from aurelia-mdc-web.

MaximBalaganskiy avatar MaximBalaganskiy commented on May 24, 2024

Ok, I think I got it

from aurelia-mdc-web.

arjendeblok avatar arjendeblok commented on May 24, 2024

Nice!

from aurelia-mdc-web.

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.