select

Better select widgets in vanilla javascript.  https://p.ce9e.org/select/demo/
git clone https://git.ce9e.org/select.git

commit
ee2b36a34286dfe9ce06a3052618cc38b245bd49
parent
4ac5822dd4b490e57bc17edcb33c3fa5bcbf1de8
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-08-09 18:23
tweak values padding

Diffstat

M select.css 2 ++
M values.js 7 +++----

2 files changed, 5 insertions, 4 deletions


diff --git a/select.css b/select.css

@@ -73,8 +73,10 @@
   73    73 
   74    74 .select__values {
   75    75 	position: absolute;
   -1    76 	inset: 0;
   76    77 	padding: 0;
   77    78 	margin: 0;
   -1    79 	border: 1px solid transparent;
   78    80 }
   79    81 .select__values li {
   80    82 	display: inline-block;

diff --git a/values.js b/values.js

@@ -27,10 +27,9 @@ export class Values {
   27    27 		// paddingTop and paddingBottom are the same
   28    28 		var paddingTop = parseFloat(style.paddingBottom);
   29    29 
   30    -1 		this.el.style.top = paddingTop + 'px';
   31    -1 		this.el.style.bottom = style.paddingBottom;
   32    -1 		this.el.style.left = style.paddingLeft;
   33    -1 		this.el.style.right = style.paddingRight;
   -1    30 		this.el.style.padding = style.padding;
   -1    31 		this.el.style.paddingTop = `${paddingTop}px`;
   -1    32 		this.el.style.borderWidth = style.borderWidth;
   34    33 
   35    34 		var n = this.el.children.length;
   36    35 		if (n > 0) {