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

ztl.hasVScrollbar detects height - it should be width

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • Core

      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

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

              Created:
              Updated:
              Resolved: