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

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

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: 8.6.0
    • Fix Version/s: 8.6.1
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.6.1 S1

      Description

      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>
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                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