Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    readOnlyDisplay as disabled renders the read-only edit field non-selectable

    Hello!

    When a read-only field is rendered as "disabled" using "readyOnlyDisplay", I would expect the rendering to honor the "canSelectText" feature.

    Here's a small test bed:

    Code:
            var form = isc.DynamicForm.create({
                showErrorText : true,
                showErrorIcons : true,
                numCols : 1,
                width : 600,
                fields : [{
                    name : 'f1',
                    editorType : 'TextItem',
                    title : 'Editable (Selectable)'
                }, {
                    name : 'f2',
                    editorType : 'TextItem',
                    title : 'Disabled (Selectable)',
                    disabled : true,
                }, {    
                    name : 'f3',
                    editorType : 'TextItem',
                    title : 'Read-Only (Selectable)',
                    canEdit : false
                }, {
                    name : 'f4',
                    editorType : 'TextItem',
                    title : 'Read-only readOnlyDisplay as Disabled expected to be Selectable',
                    canEdit : false,
                    readOnlyDisplay : 'disabled',
                }]            
            });
    
    
            form.editRecord({
                f1 : 'content',
                f2: 'content',
                f3 : 'content',
                f4 : 'content',
                });
    
            form.show();
    • The first field is a regular field, which can be edited and selected normally.
    • The second field is a disabled field - rendered as disabled (grayed out), but the content is still selectable
    • The third field is a regular field, marked as read-only (canEdit) - looks exactly like a normal field, but cannot be modified
    • The fourth field is a regular field, marked as read-only, but using "readOnlyDisplay" as "disabled" - we're expecting the field to render exactly like the second one. The rendering has the proper look, but the content is not selectable.
    We've circumvented by hackishly manipulating the style of the field to add the "Disabled" maker, but we'd rather use "readOnlyDisplay".

    Last tested using v12.0p_2020-01-17/Pro Deployment

    Thanks!

    #2
    eric.maziade.afsi,

    this thread of mine is related and I think that w.r.t. #2 of Isomorphic there the behavior of your f2-field is wrong, while I like the way it is.

    Best regards
    Blama

    Comment


      #3
      Originally posted by Blama View Post
      eric.maziade.afsi,

      this thread of mine is related and I think that w.r.t. #2 of Isomorphic there the behavior of your f2-field is wrong, while I like the way it is.

      Best regards
      Blama
      Whether disabled text should be selectable should most likely be configurable (which is where I expected "canSelectText" to operate).

      I personally always prefer text to be selectable instead of deciding for the user - but I can see why some other people would think otherwise.

      In either case, I'd expect 'readOnlyDisplay' as 'disabled' not to have different UX than having the field directly 'disabled'.

      Comment


        #4
        Hi eric.maziade.afsi,

        I agree.

        Best regards
        Blama

        Comment


          #5
          We've introduced a new property to improve the behavior in this area.

          Firstly - we can't allow text selection in truly disabled items. For accessibility reasons we want a true disabled state to be applied to the element in the DOM when disabled, which means writing out a DISABLED attribute. Native browser behavior disallows interactions including text selection in this case.

          For canEdit:false items with disabled appearance, we agree that developers may wish to allow text selection. We've therefore introduced a new attribute FormItem.readOnlyCanSelectText.
          This is set to an array of readOnlyDisplay values. By default this will be "static" and "readonly", meaning the default behavior is unchanged [selection is allowed for canEdit:false items with those appearances, but not for disabled items].
          However, you can add "disabled" to that array to allow selection of disabled-appearance canEdit:false items, or you can remove values, or even set to an empty array to disallow selection from any canEdit:false item.

          This change is already present in the 12.1 branch and will be present in 12.0 nightly builds going forward (dated Jan 28 or above)

          Regards
          Isomorphic Software

          Comment


            #6
            Hi Isomorphic,

            it seems I forgot to reply here.
            After my update v12.0p_2020-03-11 -> v12.1p_2022-08-10 I'm checking old tickets if they need any rework or I can use any of the new features.
            This is working fine for me using v12.1p_2022-08-10.

            Thank you & Best regards
            Blama

            Comment

            Working...
            X