mirror of https://github.com/twbs/bootstrap.git
				
				
				
			Merge pull request #14559 from hnrch02/properly-hide-btngroup-checkbox-n-radio
Properly hide checkbox and radio inputs in button groups
This commit is contained in:
		
						commit
						285feb4dd7
					
				| 
						 | 
					@ -226,11 +226,14 @@
 | 
				
			||||||
// Checkbox and radio options
 | 
					// Checkbox and radio options
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// In order to support the browser's form validation feedback, powered by the
 | 
					// In order to support the browser's form validation feedback, powered by the
 | 
				
			||||||
// `required` attribute, we have to "hide" the inputs via `opacity`. We cannot
 | 
					// `required` attribute, we have to "hide" the inputs via `clip`. We cannot use
 | 
				
			||||||
// use `display: none;` or `visibility: hidden;` as that also hides the popover.
 | 
					// `display: none;` or `visibility: hidden;` as that also hides the popover.
 | 
				
			||||||
 | 
					// Simply visually hiding the inputs via `opacity` would leave them clickable in
 | 
				
			||||||
 | 
					// certain cases which is prevented by using `clip` and `pointer-events`.
 | 
				
			||||||
// This way, we ensure a DOM element is visible to position the popover from.
 | 
					// This way, we ensure a DOM element is visible to position the popover from.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// See https://github.com/twbs/bootstrap/pull/12794 for more.
 | 
					// See https://github.com/twbs/bootstrap/pull/12794 and
 | 
				
			||||||
 | 
					// https://github.com/twbs/bootstrap/pull/14559 for more information.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[data-toggle="buttons"] {
 | 
					[data-toggle="buttons"] {
 | 
				
			||||||
  > .btn,
 | 
					  > .btn,
 | 
				
			||||||
| 
						 | 
					@ -238,8 +241,8 @@
 | 
				
			||||||
    input[type="radio"],
 | 
					    input[type="radio"],
 | 
				
			||||||
    input[type="checkbox"] {
 | 
					    input[type="checkbox"] {
 | 
				
			||||||
      position: absolute;
 | 
					      position: absolute;
 | 
				
			||||||
      z-index: -1;
 | 
					      clip: rect(0,0,0,0);
 | 
				
			||||||
      .opacity(0);
 | 
					      pointer-events: none;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue