Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ol.control.Button is missing disable property #1081

Closed
1Map opened this issue Jun 26, 2024 · 3 comments
Closed

ol.control.Button is missing disable property #1081

1Map opened this issue Jun 26, 2024 · 3 comments

Comments

@1Map
Copy link

1Map commented Jun 26, 2024

By looking at the documentation I can see that ol.control.Toggle has a disable property, but not ol.control.Button

@Viglino
Copy link
Owner

Viglino commented Jun 27, 2024

Disable in Toggle control is mainly to disable the interaction associated with it.
I've added setDisable and getDisable methods to Button class in the last commit.

@1Map
Copy link
Author

1Map commented Jun 27, 2024

Thanks, yes, I thought disable is to disable the button/toggle. Sometimes there is no physical "control" linked to a button and just some custom functionality. I needed a property like "disabled" that physically disable the button (greyed out) at runtime.

Something like:

    const mapMapballButton = new ol.control.Button({
      html: '<div class="fal fa-futbol"></div>',
      className: '',
      tabindex: '-1',
      disabled: true,
      handleClick: (e) => {
        return false;
      }
    });

Did you update the version. I use 4.0.18 (from npm) and cannot see your change you did.

@Viglino
Copy link
Owner

Viglino commented Jun 27, 2024

Did you update the version. I use 4.0.18 (from npm) and cannot see your change you did.
Not yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants