Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4111

Add autocorrect and spellcheck DOM attributes toggles to input-based components

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 8.6.1
    • 8.6.0
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.6.1 S1

      Current Result

      Current input based components such as bandbox, combobox, textbox, etc are relying on a DOM <input> element.
      This DOM element attributes will be processed by different browsers.
      While most browsers autocomplete only displays a thin red line below the words, safari autocorrect will automatically open a spell checking popup if the word is not recognised, which can affect UI presentation.

      Expected Result

      Developers should be able to toggle autocorrect="on/off" and spellcheck="true/false" depending on their intentions.

      Debug Info

      This is easy on textbox using xmlns:ca to just add a client-attribute to the dom, but it requires overrides for components using an <input> wrapped into a container node such as bandbox

      Workaround

      for bandbox specifically:

      <script><![CDATA[
      	zk.afterLoad('zul.inp', function() {
      		var xBandbox = {};
      		zk.override(zul.inp.Bandbox.prototype, xBandbox ,{
      			bind_ : function() {
      				var result = xBandbox.bind_.apply(this, arguments);
      				var inpNode = this.getInputNode();
      				inpNode.setAttribute("autocorrect","off");
      				inpNode.setAttribute("spellcheck",false);
      				return result;
      			}
      		});//zk.override
      	});//zk.afterLoad
      	]]></script>
      

            Leon03 Leon03
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 2 days, 4 hours Original Estimate - 2 days, 4 hours
                2d 4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 1 hour
                3d 1h