question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error While Scrolling and Region Creation

See original GitHub issue

Ive been having an issue when zoomed in and trying to scroll by grabbing the scrollbar. Each time I try to scroll it creates a new region. I want it to only create a region when clicking in the canvas area, not when trying to scroll.

I have found within the region enableDragSelection there is an eventDown click event is firing for both clicking in the waveform area and clicking on the scrollbar. I then determined when clicking on the scrollbar the tag type is Wave and when clicking within the waveform area the tag type is Canvas.

So I created a method within enableDragSelection called isCanvas

`isCanvas: function (evt) {
    if ( evt.target.tagName == 'CANVAS' ) {
        return true;
    } 
    return false;
}`

I then added in an if to check when its NOT the canvas just return out of the eventDown method

`if (!my.wavesurfer.Region.isCanvas(e)) { return; }`

Is there a better way to handle this oddity? Or is it a wanted feature?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ffxsamcommented, Oct 30, 2016

Ok cool, I can check e.target.childElementCount and if it’s greater than zero, ignore the eventDown. Will submit a PR shortly, after testing.

0reactions
ffxsamcommented, Oct 30, 2016

Unfortunately this doesn’t solve the issue. When clicking ahead of the cursor, the event tagname is “CANVAS”, but when clicking behind the cursor, the tagname is “WAVE”. However, the two wave nodes (the actual waveform and the scrollbar) are slightly different. So I can use these differences to maybe pinpoint when the user clicks the scrollbar and prevent it from doing anything.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no hotkey scrolling if //#region is collapsed (#94470) - GitHub
Issue Type: Bug if I have a collapsed region in my .ts file //#region some region if(true){ void 0 } //#endregion then when...
Read more >
Wrong exclusive scrolling region in ColScrollRegion ...
I have an UltraWinGrid with 2 ColScrollRegions. Some data resides in either side of the ColScrollRegions and the data cannot be edited so ......
Read more >
How do you create a frozen/non scrolling window region using ...
Am curious to know how you create a frozen/non-scrolling regions on a webpage using javascript! like the one used by Stackoverflow when they ......
Read more >
Common issues and resolutions for Power Apps
This article lists some common issues that you might encounter while using Power Apps. Where applicable, workarounds are provided.
Read more >
Short note on improving usability of scrollable regions - TPGi
You can make an element scrollable using CSS overflow property, problem is that typically the content cannot be scrolled using the keyboard. The ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found