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.

Disabling a button doesn't seem to be working

See original GitHub issue

Hi!

I’m trying to disable a button using the following code:

viewer.fullPageButton.disable()

In this example, the fullPageButton should be disabled and clicking on it shouldn’t activate its funcionality. But that’s not what happens, as you can see in the video: https://drive.google.com/file/d/1towUUBhWgSVJfA3bKTqWYNo8NRRP3X8r/view?usp=sharing

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
pearcetmcommented, Aug 2, 2022

@atilara In the meantime, I think the following should work - put this before you initialize a viewer:

OpenSeadragon.Button.prototype.disable = function(){
    this.notifyGroupExit();
    this.element.disabled = true;
    this.tracker.setTracking(false);
    OpenSeadragon.setElementOpacity( this.element, 0.2, true );
}

OpenSeadragon.Button.prototype.enable = function(){
    this.element.disabled = false;
    this.tracker.setTracking(true);
    OpenSeadragon.setElementOpacity( this.element, 1.0, true );
    this.notifyGroupEnter();
}

1reaction
atilaracommented, Aug 3, 2022

Okay! Thank you both for taking your time to answer!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable not working for my button - Stack Overflow
The a tag doesn't have a disabled attribute. Take a look to the doc for the valid attributes that can have.
Read more >
Disable button not working | Apple Developer Forums
I created a pointer modButton that is hooked with the Login butotn in the storyboard. I disabled it in the loginButton action method...
Read more >
Frustrating Design Patterns: Disabled Buttons
Most implementations enable the button only if all required input seems to be well-formed, or/and has been verified by an inline validator.
Read more >
Solved: Disabling a button? - Power Platform Community
Solved: Greetings, I'm having an issue with trying to make a button become disabled after it's been pressed once. I tried following the...
Read more >
Making Disabled Buttons More Inclusive - CSS-Tricks
Try to navigate the demo above using only the Tab key to go forward and Tab + Shift to go backward. You'll notice...
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