mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-08-11 21:38:54 +00:00
Make the button widget apply selectedClass correctly when the state is addressed with setTitle instead of set. Issue #9949, the button could not be rendered at all * Guard the setField read in isSelected(), which dereferenced the result of getTiddler() directly. A missing state tiddler threw a TypeError, and that tiddler is normally only created by the first click Issue #9950, every button of a set reported itself as selected * Rewrite isSelected() as an if/else. The nested ternary mixed `||` with `?:`, so the setTitle branch returned a fallback value instead of a comparison * Watch the setTitle state tiddler in refresh(), so the selected class follows the state as it already does for set Documentation and tests * Document that setField takes preference over setIndex. That has always been the behaviour, it was never written down * Document that selectedClass and default apply to setTitle as well as to set * Add wiki based test cases for the set, setTitle, setField and setIndex selection paths. Six of the seven fail against v5.4.1, the one that passes uses set, which was never broken Fixes #9949 Fixes #9950