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

setToolGroupToolStyles doesn't change the textBoxVisibility property #864

Closed
HussainHaider opened this issue Nov 2, 2023 · 1 comment · Fixed by #874
Closed

setToolGroupToolStyles doesn't change the textBoxVisibility property #864

HussainHaider opened this issue Nov 2, 2023 · 1 comment · Fixed by #874

Comments

@HussainHaider
Copy link

Describe the Bug

I'm using Annotation Tool Modes example to change the style using configuration. My intention is to hide the TextBox. I tried to use textBoxVisibility: false& textBoxVisibility: '0'. But nothing works and it still displays the TextBox.

Following is my code

const styles = {
  LengthTool: {
    colorHighlighted: 'rgb(0, 4, 255)',
    textBoxVisibility: false,
  },
  global: {
    lineWidth: '2',
    textBoxVisibility: false,
    textBoxFontSize: '20px',
    textBoxLinkLineWidth: '5',
    textBoxBackground: 'rgb(0, 4, 255)',
  },
};

annotation.config.style.setToolGroupToolStyles(toolGroupId, styles);

Steps to Reproduce

Just add the code in Annotation Tool Modes example code.

The current behavior

Screenshot from 2023-10-30 23-11-10

The expected behavior

The textBox should not be visible.

OS

Ubuntu 22.04.2 LTS

Node version

v19.4.0

Browser

Chrome

@jlopes90
Copy link
Contributor

jlopes90 commented Nov 8, 2023

if (toolGroupId) {
const styles = this.getToolGroupToolStyles(toolGroupId);
if (styles) {
// check first in the toolSpecific styles
if (styles[toolName] && styles[toolName][property]) {
return styles[toolName][property];
}
// check if we have the style in the toolGroup specific global styles
if (styles.global && styles.global[property]) {
return styles.global[property];
}
}
}

There was an error because it says false is ignored.

if (styles[toolName] && styles[toolName][property]) { the property is false, so if answer is false.

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

Successfully merging a pull request may close this issue.

2 participants