Giter Site home page Giter Site logo

Comments (3)

sweetliquid avatar sweetliquid commented on April 27, 2024

It look like React listening focusout instead of blur event, because blur event doesn't bubble up to the container. However, the focusout isn't triggered when the Done button is clicked in Chrome for iOS.

case 'focusin':
reactEventType = 'focus';
SyntheticEventCtor = SyntheticFocusEvent;
break;
case 'focusout':
reactEventType = 'blur';
SyntheticEventCtor = SyntheticFocusEvent;
break;
case 'beforeblur':
case 'afterblur':
SyntheticEventCtor = SyntheticFocusEvent;
break;

May same issue in Flutter:

Related Chrome issue:

from react.

youryu0212 avatar youryu0212 commented on April 27, 2024

Thank you for your kind response.
I think using the focusout event for onBlur's internal implementation is a matter of choice. The React team's
But I think it's unexpected behavior that it doesn't trigger when actual DOM blur occurs.

I understand that in the ios chrome environment, the DOM blur event is triggered, but the focusout is not, and that's probably an issue that either ios or chrome intended or should address.
However, I think if the DOM blur event were still triggered, the onBlur handler should still be fired.

Please feel free to share your opinions

from react.

sweetliquid avatar sweetliquid commented on April 27, 2024

Since React listens to the actual DOM events on the container and distributes them internally, and the blur event don't bubble up and can't be listened by React, focusout is used instead. It may be a lot of trouble to solve this problem without changing the way the React event system works.

from react.

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.