Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add an option to make it behave like v3 #49

Open
swey opened this issue Jan 24, 2017 · 4 comments
Open

Please add an option to make it behave like v3 #49

swey opened this issue Jan 24, 2017 · 4 comments

Comments

@swey
Copy link

swey commented Jan 24, 2017

Hi guys,

first of all: Thanks for your great work!

We want to use the tool like in the old version, which means: As long there was no explicit input, the intent should also be used to fill data-whatinput.

Maybe it's the best to add an option for that?

I think of something like

import WhatInput from 'what-input';

WhatInput.init({ useIntentAsLongThereWasNoExplicitInput: true }); // Of course with a much better naming, was just for illustration purposes

Looking forward to your feedback!

@ten1seven
Copy link
Owner

Hi @swey, thanks for the feedback!

You should be able to still get the same response as v3 by using the data-whatintent attribute or querying whatInput.ask('loose'). That was my way of preserving the v3 functionality while moving forward with what I think is a better default (I had no idea the mousemove vs. no mousemove was going to be such a topic!).

If that's not what you were looking for, can you describe your use case so I can better understand how you're using it?

@swey
Copy link
Author

swey commented Jan 25, 2017

Hi,
data-whatintent does update on mousemove and touchmove even after there was an explicit input. The old version did update on move but only as long there was the first input.

To receive the behavior of v3, you have to do something like:

[data-whatinput="initial"][data-whatintent="keyboard"] .x:focus,
[data-whatinput="keyboard"] .x:focus {
	// 1. As long there was no input, the intention should be used
	// 2. As soon there as an input, that one should be used
}

(What we want to achieve: If someone did use the keyboard, the styling should not be changed by moving the mouse around.)

@ten1seven
Copy link
Owner

Hi @swey, I just released version 5 with some breaking changes to v4 and some updated logic to how input/intent behaves. It may still not be exactly what you're looking for, but I'd appreciate it if you'd give it a look.

@swey
Copy link
Author

swey commented Sep 5, 2017

Thanks for your update, @ten1seven! I'll check it out the next days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants