What fresh hell is THIS now? - Patrick Lauke
[svinkle] @gokatgo I've used this in the past, works well! I've also started using just plain-old document.title
like so:
componentDidMount() { document.title = 'My page title'; }
Not sure what the difference between the two solutions is; seems like they produce the same solution. (thinking face emoji)
documemnt.title
, no. I guess it would depend on how you’ve setup your components. I have “page” components which use this, with child components building the content. React router is used to go between my “page” components, which on load, calls the componentDidMount()
method as illustrated above.
[morgan] @vavroom Thank you so much for your valuable answer I will certainly implement this easy solution on the small site. But just for the sake of understanding let's say we have 6, let's say now, countries; I'm now talking about my company's website, and that the switch should be shown in the header.
What pattern would you pick?
I alsocame across the "Fake Menu" pattern from Ebay (https://ebay.gitbooks.io/mindpatterns/content/navigation/fakemenu.html), it seems that this is what they are using for their page for the country switcher. I believe it can be improved though to appears in the Landmarks as "change country" navigation for instance. But it seems decent to me at first sight.
[svinkle] @thanks4allthefish I’m a fan of having the input
and the error message directly inside the label
element. This way, the error text will be announced when the input
receives focus, *and*, the label
will provide a nice, big touch/click target for folks with motor control disabilities or anyone else in a hurry.
Looks something like this:
<label for="firstName"> First Name: <input type="text" id="firstName" name="firstName" aria-invalid="true"> <span class="error">First name must not be empty</span> </label>