Skip to content

Commit

Permalink
formula field styling
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVajnagi committed Dec 3, 2024
1 parent 919b425 commit 9e63cbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/assets/stylesheets/components/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@
.auth-login-links {
@apply flex items-center justify-center gap-4 text-center border-t border-solid text-gray border-light_gray;
}

/* Formula field */
.formula{
border-radius: inherit !important;
border-color: #6b7280 !important;
overflow: hidden;
resize: none !important;
}
}
2 changes: 0 additions & 2 deletions app/javascript/controllers/textarea_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default class extends Controller {
}

resize(textarea) {
textarea.style.overflow = "hidden";
textarea.style.resize = "none";
textarea.style.height = "auto";
textarea.style.height = `${textarea.scrollHeight}px`; // Adjust height based on scrollHeight
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div>
<%= f.input :en_label, label: "Formula Label:" %>
<%= f.input :uk_label, label: "Uk Formula Label:" %>
<%= f.input :expression, as: :text, label: "Formula Expression:", input_html: {
<%= f.input :expression, as: :text, label: "Formula Expression:", input_html: { class: "formula",
data: { controller: "textarea", action: "input->textarea#input" }
} %>

Expand Down

0 comments on commit 9e63cbb

Please sign in to comment.