0
LEGEND
,
/t5/animate-discussions/placement-of-the-input-component-and-formatting/td-p/11237435
Jun 24, 2020
Jun 24, 2020
Copy link to clipboard
Copied
I am having some issues (ANCC 2019 and 2020 alike) with input components I format dynamically.
They appear shifted and have different height tho the height is assigned in CSS on different computers.
Below is the code and some screenshot to show the difference.
correct
'
incorrect position
// ***************** initial formatting ***********************
setTimeout(function () {
$(".ui-textinput").attr("autocomplete","off");
$(".ui-textinput").css({
"color": "black",
"background": "#C1F7F2",
"font-family": "'Nunito', sans-serif",
"border": "none",
"font-size": 24,
"font-weight": 600,
"text-align": "center",
"height": 33
});
}, 0);
function changetoLowerCase(evt) {
// allow only letters
var regex = /[^a-zA-Z]/g;
evt.target.value = evt.target.value.replace(regex, "");
// limit the number of characters to the longest word + 1
evt.target.maxLength = 12;
}
// ******************* events: keyup, focus, blur ****************************
// Note: blur removes the focus on an element
S2formatting.forEach(formatBox);
function formatBox(box) {
$("#dom_overlay_container").on("keyup", box, changetoLowerCase.bind(this));
$("#dom_overlay_container").on("focus", box, addBorder.bind(this));
$("#dom_overlay_container").on("blur", box, removeBorder.bind(this));
function addBorder() {
$(box).css({
"border": "3px solid black"
});
}
function removeBorder() {
$(box).css({
"border": "none"
});
}
}
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
LEGEND
,
Jun 25, 2020
Jun 25, 2020
OK. I found out that setting the height with CSS is what messes things up. I sized the components into the UI using a reference image and tested on all computers and it seems to be OK.
LEGEND
,
LATEST
/t5/animate-discussions/placement-of-the-input-component-and-formatting/m-p/11239652#M205465
Jun 25, 2020
Jun 25, 2020
Copy link to clipboard
Copied
OK. I found out that setting the height with CSS is what messes things up. I sized the components into the UI using a reference image and tested on all computers and it seems to be OK.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

