plotly / dash-html-components

OBSOLETE - now part of https://github.com/plotly/dash
https://dash.plotly.com
Other
153 stars 49 forks source link

Bug when hovering html.A #87

Closed EBoisseauSierra closed 5 years ago

EBoisseauSierra commented 5 years ago

Problem

I have a basic Dash app with a hyperlink that should change colour when hovered over. However, this doesn't happen, until I manually change the colour in my browser devtools: see this video.

MWE

Consider following folder structure:

folder/
  ├─ dash-app.py
  └─ assets/
      └─ style.css

With files as following:

from os import path as os_path

Configuring the app

app = dash.Dash( name, url_base_pathname= '/', assets_url_path= '/assets/', assets_folder= os_path.join(os_path.dirname(os_path.abspath(file)), 'assets/') ) app.layout = html.Main( [ html.P( [ ''' Morbi vitae nibh vel ex commodo tempus quis sit amet libero. ''', html.A( 'This is an inline hyperlink.', href='/', ), ''' And some more text after it. ''', ] ), ] )

if name == 'main': app.config.update({ 'routes_pathname_prefix': '/', 'requests_pathname_prefix': '/', }) app.run_server( debug=True, )

- **`style.css`**:

a { text-decoration: underline; color: inherit; } a:hover, a:active { color:   #f00; }



You can see the demo of my problem on [this video](https://streamable.com/v6lbk). I'm using Firefox Developer Edition v.65.0b5 (64-bit).
EBoisseauSierra commented 5 years ago

well… it seems that it is due to a no-break space (unicode 0000A0/C2 A0 instead of 000020/20) in the source code between color: and #f00;. Plus me using atom, which doesn't warn you when using special invisible characters.

Anyway, it's now solved. Sorry for bothering.