Skip to content

Commit 0d809ef

Browse files
fix(gradient-border.ts): fixed border radius issue in gradient border (#222)
fixed border radius issue in gradient border section closes #213
1 parent 62727b5 commit 0d809ef

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/pages/gradient-border.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function gradientBorderGenerator(): void {
1818
const showRadiusInput = utils.showRadius;
1919
const hideRadiusInput = utils.hideRadius;
2020
const resultPage = utils.getResultPage();
21-
21+
2222
resultPage.style.display = 'flex';
2323

2424
getCheckboxElement.addEventListener('change', (e: Event): void => {
@@ -30,6 +30,14 @@ export function gradientBorderGenerator(): void {
3030
}
3131
});
3232

33+
utils.getCheckbox(attribute).addEventListener('change', () => {
34+
if (utils.getCheckbox(attribute).checked) {
35+
utils.getRadiusInput(attribute).value = getBorderRadiusInput.value;
36+
} else {
37+
utils.getRadiusInput(attribute).value = '0';
38+
}
39+
});
40+
3341
const values: Values = {
3442
firstColor: color1.value,
3543
secondColor: color2.value,
@@ -71,7 +79,10 @@ function getGradientBorderResult(
7179

7280
outputElement.style.backgroundColor = 'transparent';
7381
outputElement.style.visibility = 'visible';
82+
7483
utils.getCheckbox(attribute).checked = false;
84+
utils.hideRadius(attribute);
85+
utils.getRadiusInput(attribute).value = '0';
7586

7687
const getCodeButtonElement = utils.getCopyCodeButton(attribute);
7788
getCodeButtonElement.addEventListener('click', () => {

0 commit comments

Comments
 (0)