Autocomplete experimental messages option, no results

一曲冷凌霜 提交于 2019-12-07 13:01:06

问题


I moved to jQuery UI 1.9 and have some problems with Autocomplete control. As written here they added option called messages that actually shows "No results" or results count information under the control. The problem that I can't any info about its behaviour find in the manuals.

How can I disable that option? Thank you


回答1:


Indeed not in the API documentation to the date of my answer... You can customize it this way:

  jQuery(...).autocomplete({
     messages : {
      noResults : 'No results found.',
      results : function(count) {
        return count + (count > 1 ? ' results' : ' result ') + ' found';
      }
    },
  });

NOTE: As commented by user actimel, customising is ok but do not hide it as it is part of the accessibility feature (blind users for example).




回答2:


I have been digging around this a bit and found the following:

The message is part of jQuery UI accessibility functionality and is actually never supposed to be shown (visible) and only processed by screen-readers.

All your problems will go away if you use some of the jQuery UI stylesheet files that will hide these elements for you.



来源:https://stackoverflow.com/questions/13283272/autocomplete-experimental-messages-option-no-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!