what-input icon indicating copy to clipboard operation
what-input copied to clipboard

Please add an option to make it behave like v3

Open swey opened this issue 8 years ago • 4 comments

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!

swey avatar Jan 24 '17 11:01 swey

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?

ten1seven avatar Jan 25 '17 16:01 ten1seven

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.)

swey avatar Jan 25 '17 16:01 swey

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.

ten1seven avatar Sep 05 '17 13:09 ten1seven

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

swey avatar Sep 05 '17 13:09 swey