Skip to content

IBX-9674: Fixed value coverage by action btns #1626

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

Merged
merged 3 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/bundle/Resources/public/js/scripts/admin.input.text.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function (global, doc) {
const INPUT_PADDING = 12;
const TEXTAREA_SCROLLBAR_PADDING = 6;
const EXTRA_SPACING = 6;
const togglePasswordVisibility = (event) => {
const passwordTogglerBtn = event.currentTarget;
const passwordShowIcon = passwordTogglerBtn.querySelector('.ibexa-input-text-wrapper__password-show');
Expand Down Expand Up @@ -47,12 +47,19 @@
const textWrapper = inputActionsContainer.closest('.ibexa-input-text-wrapper');
const inputType = textWrapper.classList.contains('ibexa-input-text-wrapper--multiline') ? 'textarea' : 'input';
const input = textWrapper.querySelector(inputType);
const { width: actionsWidth } = inputActionsContainer.getBoundingClientRect();

if (!input || input.type === 'number') {
if (!input) {
return;
}

const { width: actionsWidth } = inputActionsContainer.getBoundingClientRect();
if (input.type === 'number') {
input.value
? (input.style.paddingRight = `${actionsWidth + EXTRA_SPACING}px`)
: (input.style.paddingRight = `${INPUT_PADDING}px`);

return;
}

input.style.paddingRight = `${actionsWidth + INPUT_PADDING}px`;
};
Expand Down Expand Up @@ -90,7 +97,7 @@
const scrollbarWidth = offsetWidth - clientWidth;

multilineInputWrapper.classList.toggle('ibexa-input-text-wrapper--scrollbar-visible', hasScrollbar);
multilineInputWrapper.style.setProperty('--scrollbar-width', `${scrollbarWidth + TEXTAREA_SCROLLBAR_PADDING}px`);
multilineInputWrapper.style.setProperty('--scrollbar-width', `${scrollbarWidth + EXTRA_SPACING}px`);
};

doc.body.addEventListener('ibexa-inputs:added', attachListenersToAllInputs, false);
Expand Down
6 changes: 0 additions & 6 deletions src/bundle/Resources/public/scss/_inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,6 @@
&--type-number {
max-width: calculateRem(150px);

.ibexa-input-text-wrapper {
&__actions {
right: calculateRem(32px);
}
}

.ibexa-input--text {
padding-right: calculateRem(12px);
}
Expand Down
Loading