Hello Saq,

Thank you for this updated version of the radio widget.
I can confirm that it resolves the problem.


Best regards,

Eskha
Le mardi 24 novembre 2020 à 19:41:13 UTC+1, [email protected] a écrit :

> @Eshka I think you are correct that there is a bug in the refreshing of 
> the widget.
>
> There is a ticket underway with work on the radio widget which might, 
> amongst other things, resolve the problem.
>
> Could you please test this version of the widget:
>
> https://raw.githubusercontent.com/Jermolene/TiddlyWiki5/a00fc211adcf779bd0478dec4756a61f3db166f0/core/modules/widgets/radio.js
>
> If that helps please let us know, then the upcoming 5.1.23 release of TW 
> should resolve this.
> Please do delete that version of the widget after testing so that you do 
> not encounter any problems when upgrading.
>
> Regards,
> Saq
> On Tuesday, November 24, 2020 at 7:09:24 PM UTC+1 Eskha wrote:
>
>> Thank you Tones for your answer.
>>
>> Unfortunately, it does not solve my issue: to have different background 
>> color on each label when it is selected.
>> For instance a green background when yes is selected and red one when no 
>> is selected.
>>
>> After investigation, I wonder if there is not something to modify in the 
>> radio widget:
>> I have tried to add a  this.refreshSelf();
>> in RadioWidget.prototype.refresh function of the widget
>> under the if(changedTiddlers[this.radioTitle])  condition
>> and it works now without observable side effect!
>>
>> However I am not a developper therefore it may be a mistake to do this.
>>
>> Best regards,
>>
>> Eskha
>>
>>
>>
>> Le mardi 24 novembre 2020 à 00:21:01 UTC+1, TW Tones a écrit :
>>
>>> Eskha,
>>>
>>> I used your minimal test case on edge and it is not working through the 
>>> Test tiddler (Via the view template) although it works in Chrome and 
>>> Firefox.
>>>
>>> However I changed the CSS to the following and it works in edge.
>>>
>>> *.tc-radio-selected {*
>>> *background-color: #ffc;*
>>> *}*
>>>
>>> I do not know why but I think your use of label is treated differently.
>>>
>>>
>>> Regards
>>> Tones
>>> On Saturday, 21 November 2020 at 04:25:15 UTC+11 Eskha wrote:
>>>
>>>> Hello,
>>>>
>>>> I have an issue with style refresh while using RadioWidget in a view 
>>>> template element.
>>>>
>>>>
>>>> I am using Edge - Version 86.
>>>>
>>>> I have defined a style to use for the label of a a radio button input 
>>>> when it is selected (by using the "tc-radio-selected"). This is working 
>>>> when I directly use the RadioWidget  in a tiddler.
>>>> However, if I use the RadioWidget in a tiddler tagged with 
>>>> "$:/tags/ViewTemplate", the style is not refreshed unless I edit the 
>>>> tiddler or close it then open it again.
>>>>
>>>>
>>>> Here is a minimal test case with three tiddlers:
>>>>
>>>> title: Test Template
>>>> tags: $:/tags/ViewTemplate
>>>>
>>>> <$radio field="test-field" value="Y">Yes</$radio>
>>>> <$radio field="test-field" value="N">No</$radio>
>>>>
>>>>
>>>> title: Test CSS
>>>> tags: $:/tags/Stylesheet
>>>>
>>>> label.tc-radio-selected {
>>>> background-color: #ffc;
>>>> }
>>>>
>>>>
>>>> title: Test
>>>>
>>>> <$radio field="test-field" value="Y">Yes</$radio>
>>>> <$radio field="test-field" value="N">No</$radio>
>>>>
>>>> My question: How can I fix it?
>>>> (Am i doing something wrong? Is-it a widget issue? An internet browser 
>>>> issue? à
>>>>
>>>> Best regards,
>>>>
>>>> Eskha
>>>>
>>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/763d6030-2910-4ef0-90e1-74bd37c0fd06n%40googlegroups.com.

Reply via email to