Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClayCards clickable area #387

Closed
carloslancha opened this issue Dec 4, 2017 · 3 comments
Closed

ClayCards clickable area #387

carloslancha opened this issue Dec 4, 2017 · 3 comments
Labels
2.x comp: documentation Issues related to documentation in general, be clayui.com or other means...

Comments

@carloslancha
Copy link
Contributor

As lexicon defines on a selectable Card (with checkbox), this can be checked only by clicking on the checkbox itself and on the image area. Right now if you click in the bottom text area checkbox is checked too, and that shouldn't happen.

https://docs.google.com/document/d/1st2moaRVphrsFrDJUz-ic26aH-V46YkQam75X6BHPY0/edit#heading=h.ujczacaa6gt0

@pat270 pat270 added 2.x comp: documentation Issues related to documentation in general, be clayui.com or other means... labels Dec 4, 2017
@pat270
Copy link
Member

pat270 commented Dec 5, 2017

This can already be done. You just need to move the .custom-control, label, .custom-control-input, and .custom-control-indicator inside .aspect-ratio.

<div class="aspect-ratio bg-checkered card-item-first">
    <div class="custom-control custom-checkbox">
        <label>
	    <input class="custom-control-input" type="checkbox">
	    <span class="custom-control-indicator"></span>
	    <img class="aspect-ratio-item-center-middle aspect-ratio-item-fluid" src="">
	    <span class="sticker sticker-bottom-left sticker-danger">JPG</span>
        </label>
    </div>
</div>

@carloslancha
Copy link
Contributor Author

Hey @pat270 with that markup (if I've done it correctly) we have some issues:

  • On hover only bottom part gets highlighted
    captura de pantalla 2017-12-05 a las 20 11 15

  • On svg files (for example) if you click out of the svg (on the checkered background) interaction with checkbox doesn't happen.
    captura de pantalla 2017-12-05 a las 20 12 42

  • On cards without image interaction with checkbox can only be done by clicking directly on the checkbox.
    captura de pantalla 2017-12-05 a las 20 14 14

@pat270
Copy link
Member

pat270 commented Dec 5, 2017

This is the markup I tested on beta.2 - beta.4:

<div class="card-type-asset form-check form-check-card form-check-top-left">
	<div class="card">
		<div class="aspect-ratio bg-checkered card-item-first">
			<div class="custom-control custom-checkbox">
				<label>
					<input class="custom-control-input" type="checkbox">
					<span class="custom-control-indicator"></span>
					<img alt="thumbnail"class="aspect-ratio-item-center-middle aspect-ratio-item-fluid" src="../../images/thumbnail_coffee.jpg">
					<span class="sticker sticker-bottom-left sticker-danger">JPG</span>
				</label>
			</div>
		</div>
		<div class="card-body">
			<div class="card-row">
				<div class="flex-col flex-col-expand">
					...
				</div>
				<div class="flex-col">
					...
				</div>
			</div>
		</div>
	</div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x comp: documentation Issues related to documentation in general, be clayui.com or other means...
Projects
None yet
Development

No branches or pull requests

2 participants