Re: [tw5] focus=yes in edit widget causes input to be selected

2020-01-27 Thread Xavier Cazin
Hi Jeremy,

Thank you for your answer: it lead me to switch to a more idiomatic code
for the UI, which wouldn't trigger the edit-text refresh!

Cheers,
-- Xavier Cazin


On Mon, Jan 27, 2020 at 7:08 PM Jeremy Ruston 
wrote:

> Hi Xavier
>
> I think this is the venerable problem of the focus/selection not being
> retained over a refresh cycle. The only way to avoid it at present is to
> ensure that the edit-text widget doesn’t get refreshed.
>
> Best wishes
>
> Jeremy.
>
> On 27 Jan 2020, at 16:50, Xavier Cazin  wrote:
>
> Hello everyone,
>
> I stumble on an issue that I can seem to solve by myself: in the code
> below, I need to set focus=yes to counter the lost of focus caused by the
> <$set> content refresh :
>
> <$set name=foo value=<> >
>
> Refresh of the `foo` value: ''<>'' causes either //focus// or //user
> input// (when `focus=yes`) to be lost.
>
> <$edit-text tiddler="$:/state/foo" focus=yes tag=input placeholder="Try
> typing something" default=""/>
> 
>
> But then the input text gets selected as it is typed, causing the next
> character to replace the previous one. Tested on 5.1.21 and
> 5.1.22-prerelease, on Firefox and Chrome. How would you solve this?
>
> Thanks in advance for your help!
>
> -- Xavier Cazin
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/CADeSwYPUwP2jm1-aynHhaNtRSXttL%3DD6y9xWbVEUc75eWYSgQA%40mail.gmail.com
> 
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/7BBF3EB0-A866-4CD5-AB5F-FE0B0EEBF57A%40gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CADeSwYMfWRYgHWWaoNzF25mKg-xod%3DdbjtT-NLivP6POsXHGcg%40mail.gmail.com.


Re: [tw5] focus=yes in edit widget causes input to be selected

2020-01-27 Thread Jeremy Ruston
Hi Xavier

I think this is the venerable problem of the focus/selection not being retained 
over a refresh cycle. The only way to avoid it at present is to ensure that the 
edit-text widget doesn’t get refreshed.

Best wishes

Jeremy.

> On 27 Jan 2020, at 16:50, Xavier Cazin  wrote:
> 
> Hello everyone,
> 
> I stumble on an issue that I can seem to solve by myself: in the code below, 
> I need to set focus=yes to counter the lost of focus caused by the <$set> 
> content refresh :
> 
> <$set name=foo value=<> >
> 
> Refresh of the `foo` value: ''<>'' causes either //focus// or //user 
> input// (when `focus=yes`) to be lost.
> 
> <$edit-text tiddler="$:/state/foo" focus=yes tag=input placeholder="Try 
> typing something" default=""/>
> 
> 
> But then the input text gets selected as it is typed, causing the next 
> character to replace the previous one. Tested on 5.1.21 and 
> 5.1.22-prerelease, on Firefox and Chrome. How would you solve this?
> 
> Thanks in advance for your help!
> 
> -- Xavier Cazin
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to tiddlywiki+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/CADeSwYPUwP2jm1-aynHhaNtRSXttL%3DD6y9xWbVEUc75eWYSgQA%40mail.gmail.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7BBF3EB0-A866-4CD5-AB5F-FE0B0EEBF57A%40gmail.com.


[tw5] focus=yes in edit widget causes input to be selected

2020-01-27 Thread Xavier Cazin
Hello everyone,

I stumble on an issue that I can seem to solve by myself: in the code
below, I need to set focus=yes to counter the lost of focus caused by the
<$set> content refresh :

<$set name=foo value=<> >

Refresh of the `foo` value: ''<>'' causes either //focus// or //user
input// (when `focus=yes`) to be lost.

<$edit-text tiddler="$:/state/foo" focus=yes tag=input placeholder="Try
typing something" default=""/>


But then the input text gets selected as it is typed, causing the next
character to replace the previous one. Tested on 5.1.21 and
5.1.22-prerelease, on Firefox and Chrome. How would you solve this?

Thanks in advance for your help!

-- Xavier Cazin

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CADeSwYPUwP2jm1-aynHhaNtRSXttL%3DD6y9xWbVEUc75eWYSgQA%40mail.gmail.com.