After much searching and struggling I've discovered that the
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
After much searching and struggling I've discovered that the
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
Are there any common workarounds to let me style the thing
to (at least appear to) fill its containing box? Can I just simulate
one with a web component and having it look different but
feed a hidden <input> element in its shadow dom?
I suppose the answer to that last question is probably Yes.
Does this sound like a good idea?
After much searching and struggling I've discovered that the
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
Are there any common workarounds to let me style the thing
to (at least appear to) fill its containing box? Can I just simulate
one with a web component and having it look different but
feed a hidden <input> element in its shadow dom?
I suppose the answer to that last question is probably Yes.
Does this sound like a good idea?
On Fri, 28 Jul 2023 06:31:02 -0700 (PDT), luserdroog wrote:
After much searching and struggling I've discovered that the
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
Are there any common workarounds to let me style the thing
to (at least appear to) fill its containing box? Can I just simulate
one with a web component and having it look different but
feed a hidden <input> element in its shadow dom?
I suppose the answer to that last question is probably Yes.
Does this sound like a good idea?
Chances are that, whatever CSS you've tried to apply to the INPUT element,
is overidden by a higher priority styles. Meaning that, you styles aren't defined with a CSS selector which is specific enough to have a higher priority than the existing one.
Content in Shadow DOM is similar (but not the same) to a separate document
in an IFRAME. CSS rules by default, don't apply across Shadow DOM unless the correct CSS selector is used.
On Fri, 28 Jul 2023 06:31:02 -0700 (PDT), luserdroog
<luser.droog@gmail.com> wrote in <112fa9f3-7d2d-4c3b-b417-655eb0776264n@googlegroups.com>:
After much searching and struggling I've discovered that the
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
Are there any common workarounds to let me style the thing
to (at least appear to) fill its containing box? Can I just simulate
one with a web component and having it look different but
feed a hidden <input> element in its shadow dom?
I suppose the answer to that last question is probably Yes.
Does this sound like a good idea?
If you have
<input id='a' size='10' value='123'>
then adjust the size with
document.getElementById('a').setAttribute('size', 15) ;
If you have
<input id='b' style="width:10em" value='123'>
then adjust the width with
document.getElementById('b').style.width='25em' ;
You probably want to investigate getting width of a string and using a
fixed width font to get things to fit. "onchange" is useful.
You could also replace the input element with a bordered string inline
after the value is entered.
<span style="border:red 1px solid;">12345</span>
After much searching and struggling I've discovered that the
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
luserdroog <luser...@gmail.com> writes:
After much searching and struggling I've discovered that theCan you say more? Are you limited to what browsers you must support. I thought you could style the width in most.
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
luserdroog <luser...@gmail.com> writes:
After much searching and struggling I've discovered that theCan you say more? Are you limited to what browsers you must support. I thought you could style the width in most.
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
On Friday, July 28, 2023 at 2:11:45 PM UTC-5, Ben Bacarisse wrote:
luserdroog <luser...@gmail.com> writes:
After much searching and struggling I've discovered that theCan you say more? Are you limited to what browsers you must support. I
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
thought you could style the width in most.
Oops, other question. Nope, I can safely assume/require the latest versions of chrome or firefox. In fact I'm relying on this for the next rewrite that'll use the new compression/decompression stuff.
On Monday, July 31, 2023 at 10:49:18 AM UTC-5, Ben Bacarisse wrote:
luserdroog <luser...@gmail.com> writes:
On Friday, July 28, 2023 at 2:11:45 PM UTC-5, Ben Bacarisse wrote:
luserdroog <luser...@gmail.com> writes:
After much searching and struggling I've discovered that theCan you say more? Are you limited to what browsers you must support. I >> thought you could style the width in most.
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
Oops, other question. Nope, I can safely assume/require the latest versionsSo now I don't know what the problem is!
of chrome or firefox. In fact I'm relying on this for the next rewrite that'll use the new compression/decompression stuff.
All good now. style="width:inherit" did the trick.
It's beautiful. sniff.
luserdroog <luser...@gmail.com> writes:
On Friday, July 28, 2023 at 2:11:45 PM UTC-5, Ben Bacarisse wrote:
luserdroog <luser...@gmail.com> writes:
After much searching and struggling I've discovered that theCan you say more? Are you limited to what browsers you must support. I
only way to adjust the size of an <input type=text> element is
with its size="number-of-chars" attribute.
thought you could style the width in most.
Oops, other question. Nope, I can safely assume/require the latest versionsSo now I don't know what the problem is!
of chrome or firefox. In fact I'm relying on this for the next rewrite that'll use the new compression/decompression stuff.
[...]
The context is a text edit widget that manifests inside a spreadsheet-like table view of personnel scheduling data. Clicking a cell turns the <td><span/></td> into a <td><input></td> and then onchange or onblur on
the input changes it back to a span.
On Monday, July 31, 2023 at 8:53:58 AM UTC-5, luserdroog wrote:
[...]Is it not simpler to keep <td><input></td> and then with clicking toggle the readonly attribute?
The context is a text edit widget that manifests inside a spreadsheet-like table view of personnel scheduling data. Clicking a cell turns the <td><span/></td> into a <td><input></td> and then onchange or onblur on the input changes it back to a span.
The css :read-only selector will allow you to control appearance.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 251 |
Nodes: | 16 (2 / 14) |
Uptime: | 100:22:06 |
Calls: | 5,516 |
Calls today: | 4 |
Files: | 11,669 |
Messages: | 5,089,169 |