zoukankan      html  css  js  c++  java
  • A bug about RecipientEditTextView

    - Steps to reproduce the problem.
      Pre-condition:the threshold of the RecipientEditTextView is set to 1.
      Step1: type chars and select a item from the dropdown listitem 
      Step2: type "," or ";".
    
    - What happened.
      The first position item of the previous dropdown list which showing in step1 is submitted to the RecipientEditTextView.
    
    - What you think the correct behavior should be.
      The char "," or ";" should be submitted to the RecipiemtnEditTextView.
    
    I think the point is the Threshold of the RecipientEditTextView is set to 1, and the following code snippet is where cause the issue:
    
     private boolean commitChip(int start, int end, Editable editable) {
            ListAdapter adapter = getAdapter();
            if (adapter != null && adapter.getCount() > 0 && enoughToFilter()
                    && end == getSelectionEnd() && !isPhoneQuery()) {
                // choose the first entry.
                submitItemAtPosition(0);
                dismissDropDown();
                return true;
            } else {
    
    the if condition should be modified like this:
    
    private boolean commitChip(int start, int end, Editable editable) {
            ListAdapter adapter = getAdapter();
            if (adapter != null && adapter.getCount() > 0 && enoughToFilter()
                    && end == getSelectionEnd() && !isPhoneQuery()
                    /*The dropdown listitem should only be submitted when the PopupWindow is showing.To prevent the below case happening:
                      When a dropdown listitem has been submitted, and the getThreshold()==1, and the input char is a single COMMIT char,
                      such as ',' or ';', the first position item of the previous list will be submitted to the EditText */
                    && isPopupShowing()) {
                // choose the first entry.
                submitItemAtPosition(0);
                dismissDropDown();
                return true;
            } else {


    https://code.google.com/p/android/issues/detail?id=73076
  • 相关阅读:
    NOI-01:查找最接近的元素 基本二分
    C#学习笔记之——数据库操作的相关类
    Lua学习笔记——环境安装(Windows和MacOS)和在MacOS安装时错误解决方法
    Ubuntu下对数据库的操作
    Git常用操作
    [Unity游戏开发]常用类之Time类
    [Unity游戏开发]四元数Quaternion
    [Unity游戏开发]常用类之Transform类
    [Unity游戏开发]常用类之Component类
    [Unity游戏开发]射线(Ray)
  • 原文地址:https://www.cnblogs.com/haobo/p/3844527.html
Copyright © 2011-2022 走看看