Giter Club home page Giter Club logo

Comments (15)

ai avatar ai commented on May 28, 2024

@theKashey not sure that I describe it correctly, maybe I describe it better in Telegram :D

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

This is somehow related toallowTextSelection prop (#10). This option just allow "not" to have an active element in the lock.
It does not disable autofocus, but you can blur by your self.

https://codesandbox.io/s/oj01rx089y

from react-focus-lock.

ai avatar ai commented on May 28, 2024

Awesome. Thanks!

from react-focus-lock.

ai avatar ai commented on May 28, 2024

Should we change docs?

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

Should we change a prop name? :)

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

Even more - should it be a single prop, or two?

  • shouldHaveFocus, about allowing not to have a focused element. Maybe disabled by default.
  • nofocus(autofocus=false?), about just blurring the active one on lock activation. As long you (usually) have to press some button to open something with a Lock, so the goal is to remove focus from "not Lock", but not had in Lock.

Proper naming always were a problem.

from react-focus-lock.

ai avatar ai commented on May 28, 2024

I like this plan 👍 especially autobluring :)

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

Ok, lets flip a coin - nofocus=true/autofocus=false ?

from react-focus-lock.

ai avatar ai commented on May 28, 2024

autofocus is not very clear because it looks like related with autofocus attribute.

Maybe initialFocus: true|false?

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

For me initialFocus sounds like a focus "target", not the behaviour.

from react-focus-lock.

ai avatar ai commented on May 28, 2024

focusOnStart?

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

focusOnLock then, or noautofocus, looseFocus, blurred, dontFocus. Meh 💩
I should ask my real english mates.

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

They proposed autoFocus=false as a best property name.
The bad thing - currently allowTextSelection disables that autofocus, and letting you not have a focus inside, doing all the things in a same time, and has to be refactored.

from react-focus-lock.

theKashey avatar theKashey commented on May 28, 2024

@ai - v1.7.0 just got shipped.
See https://github.com/theKashey/react-focus-lock/releases/tag/1.7.0 for details.
PS: just <FocusLock autoFocus={false}>....

from react-focus-lock.

ai avatar ai commented on May 28, 2024

Thanks :) Everything works

from react-focus-lock.

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.