Uploaded image for project: 'ZTL'
  1. ZTL
  2. ZTL-27

ztl.hasVScrollbar detects height - it should be width

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:

      Description

      Steps to Reproduce

      <div id="wrapper" style="width: 500px; height: 500px; overflow: auto;">
          <div style="width: 1px; height: 2000px"></div>
      </div>
      
      ...
      await t.expect(await ztl.hasVScrollbar({locator:Selector(() => jq('#wrapper')[0])})).ok();
      

      Current Result

      It returns false even a vertical scrollbar is presented.

      Expected Result

      It returns true.

      Debug Information

      export async function hasVScrollbar(config) {
      	config.locator = await config.locator();
      	return await ClientFunction(() => {
                              // omitted
      			var borderHeight = Math.round(parseInt(locator.css('borderLeftWidth'))) + Math.round(parseInt(locator.css('borderRightWidth'))),
      				scrollbarHeight = locator[0].offsetHeight - borderHeight - locator[0].clientHeight;
      			return scrollbarHeight > 0;
      		}
      	}, {dependencies: {config}})();
      }
      

      Looks like it's copied from hasHScrollbar.

      Workaround

        Attachments

          Activity

            People

            Assignee:
            DevChu DevChu
            Reporter:
            rudyhuang rudyhuang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: