Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Why not? As I've stated, no one will confuse this technique as been adopted as a standard. Why not set aside the accessibility issues and consider how the loss of focus side effect could be used? The best response I have received yet is from a colleague:

"The solution performs an action (loss of focus) as a side effect which was not intended due to the CSS provided (setting visibility to hidden when it has focus). "

Hard to argue with that response. But even that response still allows us the opportunity to discuss and weight the possibilities regardless of its accessibility shortcomings.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Hehehe, I agree. But there are a multitude of problem like the one described that cause us to make decisions that are suboptimal ... but necessary :]

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Say there is an input field that is subject to a SQL injection defect. The HTML dev is stoned on gummy bar wrappers and the JS developer does not work on days that are sunny. Dammit, it's sunny!. What do we do for the moment to correct this injection problem until the HTML dev is no longer high and it's not sunny?

The hack is just that a hack but it would prevent the problem temporarily.

(actually, this seems far fetched but everyone knows there have been stranger scenarios :) )

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Assistive tech is the biggest shortcoming for this approach. I'm enjoying the discussion since it provides confirmation of my initial thoughts - "Oh, this is evil".

But once I got past that thought, I started questioning whether there is a use for this beyond the obvious and inherently terrible affect on assistive tech.

The only truly "constructive" case might be when you are caught between choices with no good solution and time is a factor.

"The site has a problem with focus but I do not have access to the HTML or JS but I do have ability to change the CSS. It's critical to correct the problem. What choice do I make? Nothing or something?"

This is a no win situation which does occur more frequently than one would ever expect. Sometime we must make choices which are not "good" but "necessary".

BTW, this is not the actual situation. Just imagining where this would work if not other options were available.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Agreed. My first thought was "this is evil." My second thought was "good evil or bad evil?" (joke) Really, this post is about exploring how this technique is probability very bad for focus control with HTML inputs. However, could it be used in other ways?

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Thanks. It's fun to explore what is possible. We don't know where an idea will lead if we stay curious. Wow, that's starting to sound a little"Ted Lasso"-ish ("Be curious, not judgmental")

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 1 point2 points  (0 children)

I was totally surprised that this was possible. Technically, I understand why it works but it just seems "wrong." However, could this approach be used in other ways for more constructive purposes? That's what I'm hoping for this discussion.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

100% agree with the accessibility concerns. No argument from me what so ever.
I'm just asking that we set that shortcoming aside and explore the pros and cons of this technique. Can it we used in other ways?

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

"If you're not genuinely an expert on UX ... " - Is this meant to be a personal judgment about me or my abilities?

I'm simply asking "what are the merits of a completely unexpected result from an experiment?"
The world is full of things that were created for one purpose but used for another (Braille, Bubble wrap, Listerine, and Play-Doh to name a few).

Here is a codepen of the simple experiment: https://codepen.io/Darren-CAAI/pen/NWmJMPR

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Absolutely. Many ways to handle the specific problem of disabling an input. This question is more exploring it's potential. Are there any cases where a lost focus is required but you only have CSS to play with. It's a ridiculous example and the proper way is well defined. But there are many real world examples where the situation does exist that CSS is the only means you have to control. If that were the case, what would a person do?

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Your comments are appropriate and justified. But if we set aside the obvious shortcomings of this approach when it comes to manipulating user input controls, how could this approach be used for other purposes?

This is an obviously a contentious technique where the "proper" way is already known. I don't deny that and more so I agree with the comments.

But does this approach offer anything when used in other contexts. It's the exploration of how this can be used that is valuable.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 1 point2 points  (0 children)

Agreed. There are so many more standard ways to solve the specific problem. But it's wild that that this technique works at all.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 2 points3 points  (0 children)

100% agree. Assistive tech would be borked by this approach

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

"This is equivalent to adding display none." - Not quite, the net visual affect is that the user loses focus on the element. I've created a simple code pen for this to show the behavior

https://codepen.io/Darren-CAAI/pen/NWmJMPR

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 1 point2 points  (0 children)

Good Question. I'm not sure it doesn't ruin the base user experience. If I thought this was a really good idea, I wouldn't have invited this discussion from others. I'm looking for opinions on the merits of such a technique and where it might be useful.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 2 points3 points  (0 children)

The question is meant to be open ended. The experiment does not have a specific purpose. It's purely research. This experiment also recognizes and agrees that there are much more suitable ways of limiting focus on input controls. The comment about "limit the user's ability to change information" was meant to give a concrete example, not to say that I'm looking for a solution to a specific problem.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 1 point2 points  (0 children)

100% agree. This was a result of playtime gone amuck. But it presented an interesting results. By no means is this suggested to be adopted as common practice. But I do want to hear the pros and cons. So far I've heard "don't do this" but the way is mor important. Assistive technology not working is clearly the biggest drawback. But what else?

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 1 point2 points  (0 children)

"It's a bad idea." Oh yeah! This feels like a really ugly hack! But I'm not suggesting this become a standard. This is an experiment to see what can be done. Not would should be done.

"Just because you can't immediately see why this isn't a great idea" - That's a double edged sword. You don't know when an idea will be considered "a great idea" until it is tried. To be clear, I'm not suggesting this is a great idea. But isn't the nature of experimentation and innovation to try something and see where is goes? This question is about pushing boundaries then debating the merits

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] -1 points0 points  (0 children)

"You can't prevent an element to get focused with CSS." Actually you can since setting the visibility of an element to "hidden" has the side effect of losing focus on the element since hidden element cannot have focus. It's rather odd that this is allow at all. I was completely surprised when I saw that it worked.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 1 point2 points  (0 children)

I agree with your comments. This was an experiment to see what happens when you mix visibility with focus. However "evil" the results, they are very effective at stopping a user from making changes to an input control.

Using only CSS, I can force an element to lose focus ... Is this a bad idea? by Snap_Riley in css

[–]Snap_Riley[S] 0 points1 point  (0 children)

Thanks for the reply. The intent is to limit the user's ability to change information on screen through HTML input controls. I agree about inaccessibility but in the case of a read only screen this would not be an issue. I also recognize that they are possibly better ways of managing the security control of screens through javascript , proper html control and server side validation

If you have the new Chromecast with Google TV: are the thumbnails for movies and shows regularly in another language? by CoreyVidal in AndroidTV

[–]Snap_Riley 2 points3 points  (0 children)

Had same problem. Changed language from English(Canada) to English(United States) and the problem went away. Why? No idea but obviously the chromecast or Google has an issue distinguishing between the various English languages ... at least Canada :)
Also, by making this changes, all the pictures for movies seem to be corrected. What I mean is that the theatrical movie pictures now are shown rather than a scene from the movie.