Text truncation listener - css

I want to create a responsive button that has a title and a leading icon. What I want to do is, when the viewport is decreasing, detect when the text starts to get truncated, at which point I would like to remove the title altogether and leave just the icon.
Can this be done with CSS alone?
If not, can this be done with JavaScript?

Related

Angular Material: Textarea with fixed height

I want to have a page which has two main components. On the upper half a textarea on the lower half some input fields. The split should be 50:50. The problem I'm facing:
I cannot tell the textarea to fill the complete height when displayed. I know I can use some cdk..MinRows or ...MaxRows but therefore I need to know the whole height before. Additionally the underline looks also quite strange, e.g.
How to fix it? Does it work with Material or should I use plain HTML textarea? My project

text display starting from bottom up qt

How would I display text in something like QTextEdit starting from bottom up? QTextEdit starts writing at the top filling down to bottom. I want to start from the bottom and then pushing the previous text up as more text is added. I figure I could hack it and simply fill the field with nextlines to reach the bottom then reprinting whatever was written before again when text is to be added, but I wouldn't want to do that unless there isn't any other way.
insertPlainText inserts text at the current text position. You could move the cursor to the start of the docuement using the moveCursor function.
Every time you want to add some text do the following:
textEdit->moveCursor(QTextCursor::Start);
textEdit->insertPlainText(textToBeAdded);

textinput box with inline image

Is there any way to create a textInput box for flex mobile with inline image without using textflow ?
Basically i need a text input component , so that user can just use it as normal text input box but to it images can also be entered inline with text. To enter images user can select the image from list and that image will get inserted at the current cursor position.
If you look at any platform, there is no user experience (as far as I've seen) that lets you add images in the text input box. It's always been straight text, except for android which replaces certain text with icons (like :-) becomes an android icon). I don't think your users would expect that behaviour. If you really do need it, I would recommend you create a custom skin for your textinput box and add that feature into it, but it won't be easy to do.

Prevent Chrome/Browsers from resizing/restyling form elements

Chrome has some cute features to make the selected form element (input ect) stand out like adding a border color and, more annoyingly, it slightly reduces the margins on some of my form elements after they've been selected, shifting the page slightly each time a text entry box is selected.
It's not the textarea draggable resize effect that chrome has, it's effecting input elements that should have a constant size, but they automatically change once selected.
Is there any CSS to disable this feature, or do I simply have to make sure my text box margins/padding are set up such that Chrome doesn't resize them?
Here it is
textarea { resize:none; }
I love working on other people's sites...the problem was javascript they were using to restyle form elements after click and I have no idea why. Solution was to remove that junk.

No linebreak in ASP.NET

just wanna ask is it possible to remove the linebreaks? Now I want to have a row of textbox, buttons and a combobox, but the combobox will be at new line when I run the application. So is there a way to stop it from going to a new line? Thanks.
Setting the form elements style display property to "inline" will ensure they fall on the same line until they run out of space, at which point of course, they have to go to the next line. Now you can set the height and width properties on the form elements so they all fit on the same line, and even expand to fill the available space if needed.
The combo box should have it's style display property set to block, so it will fall on the next line automatically. EX: Style="display:block"
Are you running out of vertical space? Inline is the solution if not, as some elements may default to block and add a new line.
But if you want everything to be on the same line, but are running out of space, you could try specifying for a root element style="white-space:nowrap;". I forget if it's white-space or whitespace, but either it would prevent wrapping of elements that way.

Resources