loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix Fomantic UI dropdown icon bug when there is a search input in menu (#27225)

Fix #27224

And add the case to the devtest page.

authored by

wxiaoguang and committed by
GitHub
efd51762 da0467e3

+4
+1
templates/devtest/gitea-ui.tmpl
··· 171 171 <span class="text">simple</span> 172 172 {{svg "octicon-triangle-down" 14 "dropdown icon"}} 173 173 <div class="menu"> 174 + <div class="ui icon search input"><i class="icon">{{svg "octicon-search"}}</i><input type="text" value="search input in menu"></div> 174 175 <div class="item">item</div> 175 176 </div> 176 177 </div>
+3
web_src/js/modules/fomantic.js
··· 16 16 $.fn.dropdown.settings.fullTextSearch = 'exact'; 17 17 // Do not use "cursor: pointer" for dropdown labels 18 18 $.fn.dropdown.settings.className.label += ' gt-cursor-default'; 19 + // The default selector has a bug: if there is a "search input" in the "menu", Fomantic will only "focus the input" but not "toggle the menu" when the "dropdown icon" is clicked. 20 + // Actually, the "search input in menu" shouldn't be considered as the dropdown's input 21 + $.fn.dropdown.settings.selector.search = '> input.search, :not(.menu) > .search > input, :not(.menu) input.search'; 19 22 // Always use Gitea's SVG icons 20 23 $.fn.dropdown.settings.templates.label = function(_value, text, preserveHTML, className) { 21 24 const escape = $.fn.dropdown.settings.templates.escape;