Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-14087

Autocomplete needs two clicks to open

    XMLWordPrintable

    Details

    • Steps to Reproduce:
      Hide
      <?xml version="1.0" encoding="UTF-8" ?>
      <ui:composition xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
      	xmlns:c="http://java.sun.com/jsp/jstl/core"
      	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich"
      	xmlns:fn="http://java.sun.com/jsp/jstl/functions">
       
      	<f:view>
      		<h:head></h:head>
      		<h:body>
      			<c:set var="value" value="Test 3" />
      			<rich:autocomplete value="#{value}" mode="client" minChars="0" autofill="false" showButton="true"
      				autocompleteList="#{fn:split('Test 1, Test 2, Test 3', ',')}" />
      		</h:body>
      	</f:view>
      </ui:composition>
      
      1. Click the button
      2. Click the button again
        => It needs two clicks for the suggestion box to open

      For IE11 (do previous steps first):

      1. Click somewhere on the page
      2. Open the suggestion box again
      3. Click somewhere on the page
      4. Click somewhere on the page agein
        => It needs two clicks for the suggestion box to close
      Show
      <?xml version= "1.0" encoding= "UTF-8" ?> <ui:composition xmlns:h = "http://java.sun.com/jsf/html" xmlns:f = "http://java.sun.com/jsf/core" xmlns:c = "http://java.sun.com/jsp/jstl/core" xmlns:ui = "http://java.sun.com/jsf/facelets" xmlns:rich = "http://richfaces.org/rich" xmlns:fn = "http://java.sun.com/jsp/jstl/functions" > <f:view> <h:head> </h:head> <h:body> <c:set var= "value" value= "Test 3" /> <rich:autocomplete value= "#{value}" mode= "client" minChars= "0" autofill= "false" showButton= "true" autocompleteList= "#{fn:split( 'Test 1, Test 2, Test 3' , ',' )}" /> </h:body> </f:view> </ui:composition> Click the button Click the button again => It needs two clicks for the suggestion box to open For IE11 (do previous steps first): Click somewhere on the page Open the suggestion box again Click somewhere on the page Click somewhere on the page agein => It needs two clicks for the suggestion box to close

      Description

      When value is set, it takes to clicks on the button to open the suggestion box. In IE it also takes two clicks to close it.

      It takes two clicks, because the autocomplete is marked as changed when a value is set:

      // AutocompleteBase.js
      this.tempValue = this.getValue();
      this.isChanged = this.tempValue.length != 0;
      

      The autocomplete is only shown if isChanged is false (see onShow).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                michpetrov Michal Petrov
                Reporter:
                sandro.braendli Sandro Brändli
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: