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

RollbackWorkloadDialog: Direct Manipulation of CSS in sizeDialog() Function #10559

Open
rak-phillip opened this issue Mar 5, 2024 · 0 comments
Labels
kind/tech-debt Technical debt

Comments

@rak-phillip
Copy link
Member

The sizeDialog() function in the close workload dialog directly modifies CSS properties of elements owned and maintained by vue-js-modal. This approach raises concerns about maintainability for two reasons:

  1. vue-js-modal or our modal implementation could change - leading to unintended regressions in the behavior of this dialog
  2. Directly manipulating CSS may have unintended side-effects, where these styles may be applied dynamically or overridden by other CSS rules

Proposed Change

Instead of directly manipulating CSS, consider emitting an event from the component to signal the need for dialog sizing changes.

Referenced Code

sizeDialog() {
const dialogs = document.getElementsByClassName('v--modal');
const width = this.showDiff ? '85%' : '600px';
if (dialogs.length === 1) {
dialogs[0].style.setProperty('--prompt-modal-width', width);
}
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/tech-debt Technical debt
Projects
None yet
Development

No branches or pull requests

2 participants