question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

form-select-plaintext

See original GitHub issue

Prerequisites

Proposal

I’d like to style a select element (or any element, really) such that it has the same padding, margins, flow, etc, but appears as plaintext (meaning no border, no dropdown chevron, etc). Effectively like form-control-plaintext, but for selects.

Motivation and context

I have some text in a table, and when its not editable, I want it to look like plain text. When the user clicks the edit button, I want the select dropdown to appear “around” the existing text, without shifting anything else on the page.

I’ve tried doing this with some complex calc()s for padding, but I can’t seem to get it just right…

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
WinterSilencecommented, Feb 10, 2022

See #35688

When the user clicks the edit button, I want the select dropdown to appear “around” the existing text, without shifting anything else on the page.

You can use Datatables: inline editing or something like this. If you want simple solution, then set transparent border/background for “readonly” fields:

.inline-editable {
  .form-control,
  .form-select {
      &[readonly] {
         border-color: transparent;
      }
  }
  .form-select[readonly] {
      background-color: transparent;
      background-image: none;
  }
}

or you can customize .form-control-plaintext like as #35809 and prepend class to fields: <input class="form-control-plaintext form-control" ...>

0reactions
gianlucagiacometticommented, Nov 21, 2022

You can try my select extension for Bootstrap (https://github.com/gianlucagiacometti/bootstrap-select) with the form-select-plaintext class

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found