"Modifying the form-control-lg class in Bootstrap and AngularJS affects input size exclusively, leaving the label unaffected

Currently, I am focusing on enhancing an AngularJS custom text input component:

<div class="form-group has-feedback"
     ng-class="[$ctrl.sizeClass, {'has-error': $ctrl.isNotValid(), 'has-success': 
     $ctrl.isValid()}]"
>
   <label class="control-label col-xs-3" for="{{$ctrl.name}}">
    <span ng-bind="$ctrl.label"></span>
    <small ng-if="$ctrl.isRequired">
      <span aria-hidden="true" class="text-danger">
        *
      </span>
      <span class="sr-only">
        (field is required)
      </span>
    </small>
   </label>
   <!-- The input functions correctly -->
</div>

I aim to implement sizing based on the Bootstrap form-group sizing:

var sizes = {
  'sm': 'form-group-sm',
  'lg': 'form-group-lg',
};

$ctrl.$onChanges = function (changes) {
  if (changes.size) {
    $ctrl.sizeClass = sizes[$ctrl.size];
  }
} 

Although the size of the input adapts appropriately, the size of the label remains constant. There seems to be a minor issue that I cannot pinpoint. Your assistance would be greatly appreciated. Thank you in advance for any help provided.

Answer №1

It appears that there is some CSS code that you may have overlooked:

.form-horizontal .form-group-sm .control-label {
  margin-top: 10px;
  font-size: 14px;
}

Answer №2

I have discovered a solution to the issue at hand. It appears to be related to Bootstrap's CSS media query:

@media (min-width: 768px) 
.form-horizontal .form-group-lg .control-label {
    padding-top: 11px;
    font-size: 18px;
}

Upon further investigation, it seems that the Plunker window is actually narrower than 768 px (you can test this by resizing the code panel). I will be bringing up this matter as an issue on Bootstrap's Github repository. The issue has been reported here: Sizes for form-horizontal's .control-label on min-width < 768px does not work as expected for .control-label but work for .form-control (visible with with .col-xs-*).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The power of the V8 JavaScript engine: Understanding v8::Arguments and the versatility of function

I have created a Node.js addon that wraps a C++ standard library element std::map<T1,T2>. The goal is to expose this map as a module with two primary functions: Set for adding new key-value pairs and Get for retrieving values by key. I want to create ...

Certain images are being rotated in a counter clockwise direction by 90 degrees

Users can upload images of their items, but some pictures appear rotated 90 degrees counter-clockwise after uploading. This could be due to the way the photos were taken on an iPhone. Is there a simple solution to correct this rotation issue? The following ...

Breaking the link from the image it is connected to using [middleman] css and html

My question is about an icon with a link attached to it. <%= link_to image_tag("infobutton_circle_blue.png") ,"http://redbullrecords.com/artist/awolnation/", :id => "about" %> After applying styles, the link may not work properly: <a id="abo ...

When using Firestore in Android, I encounter a nodejs error regarding headers being sent prematurely

Currently, I am utilizing a webview in order to display content from a nodejs server. While requesting a page works as expected, accessing firestore results in an error where it seems like nodejs is attempting to resend the page. Below is the code for an a ...

Ways to halt a script entirely once its tag has been eliminated

I have a script from a page tracker website that runs periodically. Occasionally I need to restart the script from the beginning. To do this, I typically remove the script tag from the DOM and then re-append it. However, because the script utilizes setInt ...

Guide to making a dropdown menu that pulls information from a text box and displays the location within the text

I'm currently working on a unique dropdown feature that functions like a regular text field, displaying the text position. To achieve this, I've constructed a hidden dropdown menu positioned beneath the text field. My goal is to develop a jQuery ...

Using array map to create a centered table in a React web application

In my React project, I created a table using the array.map function. However, I'm facing an issue where the output of array.map is always aligned to the left, even before the table itself. I want to center the entire table. JSX: <div className=&qu ...

Leveraging the For loop in the MongoDB Aggregation pipeline

Seeking a more efficient way to query data in MongoDB. In my collection, I store hourly information for each user_id. Each document in the collection corresponds to a unique user_id and date combination. However, a user_id can have multiple entries with d ...

The image is not appearing on the webpage even though the online URLs are functioning correctly

I am currently facing an issue with my Django portfolio website where I cannot get my photo to display even though the path is correct. However, online images are displaying properly on the site. <html lang="en"><head><link href="https: ...

What is the best way to increase a specific value in an array of objects once it has been located (using findOne()), but before it is

I'm looking for a more efficient way to update an object within an array of schemas in one database request instead of two. Currently, I use findOneAndUpdate() to increment the field if the object already exists, and then I have to use update() if the ...

Can you explain the functionality of this code snippet from a slate.js demonstration?

Trying to grasp the concepts of Slate.js, I delved into the rich text example. Within it, I encountered a code snippet that has left me puzzled. const isBlockActive = (editor, format) => { const [match] = Editor.nodes(editor, { match: n => ...

Prevent VueJs draggable from adding elements without cancelling the drag preview

Currently, I am exploring the functionality of draggable and sortable with VueJS by using Vue.Draggable library. My goal is to create a scenario where I have two lists: the first list contains sections like tables and paragraphs, while the second list cons ...

Struggling to properly center the footer on my Django template

I'm currently facing an issue when attempting to align my footer in the center of my Django template. The specific class for the footer is Pagination. Base HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict ...

how to create a smooth transition back to the original state after a click event

I've put in a lot of effort to make sure my code for the DECAY shapes is correct up to this point. The click event I implemented makes the shapes gradually start being affected, just as I intended. However, once I release the mouse or finger, it insta ...

Acquiring data within a jade template in order to generate static HTML pages

I am struggling to pass data to a jade template in order to generate static content. While I am not well-versed in node.js and express, I use jade as a template engine for creating static html. Many of the requests in the jade issue list pertain to includ ...

An AngularJs library designed for storing data

Is there a library similar to Ember Js and Persistence for AngularJs, or is it in the works? Maybe there is a framework-independent solution available? What I am looking for is a library that can: Define my object model Establish relationships between m ...

Changes in React BrowserRouter URLs are not reflected on the page or components, requiring a manual refresh for them to

Greetings, fellow developers! I have developed an app using React with a remote menu component. Despite trying numerous techniques, I am facing an issue where my URL changes but the components are not rendering on the screen. You can check out the code h ...

Incorporating the "+ " icon in Vuejs Dropzone to indicate the presence of existing images

Looking to enhance my Vue-dropzone file uploader component by adding an icon or button labeled "Add more images" when there are already images present in the dropzone. This will help users understand that they can upload multiple photos. Any suggestions on ...

Issue encountered in NestJS/TypeORM: Unable to modify the property metadata of #<Repository> as it only has a getter method

When attempting to launch my nestjstutorial app, I encountered the following error message. The backend is connected to a PostgreSQL database. TypeError: Cannot set property metadata of # which has only a getter at EntityManager.getCustomRepository (D:&b ...

Pattern matching to verify a basic number within the range of [0-6]

const number = '731231'; const myRegex = /[0-6]/; console.log(myRegex.test(number)); Could someone provide some insight into this code snippet? In my opinion, the regular expression [0-6] should only match numbers between 0 and 6. However, i ...