Posts

UX research resources including W3C and Nielsen and examples for accessible ui controls

  Nielsen Norman Group is a good resource for UX research articles e.g. SplitButton guidance Bootstraps split button implementation: https://getbootstrap.com/docs/5.2/components/dropdowns/#split-button notice the html Material UI is another good resouce for UX and compoents. Here's their Accordion implementation For web accessibility the W3C has good guides: Main page Read this first Their patterns page is a good resource e.g. Date Picker combobox , Tabs pattern   For quick lookup by control, checkout the index Interesting css for toggle btn

react-select stacking order bug, z-index, layers and stacking

Image
Had to fix a tricky bug related to react-select recently (our Dropdown component wraps react-select). Here's the how the bug manifested. Dropdown does not overlay dynamically added content below it Variations of this have been reported since 2017. But I tried all the suggestions in the comments and none worked for me. I also tried wrapping the Dropdown in a div and changing z-index to be higher as well as making absolute position but no success. Changing the elements order in the html source and then reordering using flexbox order does work but it breaks the tabbing flow and is not recommended from an accessibility standpoint. One issue is the Dropdown is in a container and is constrained by the containers z-index. No matter how I change the Dropdowns z-index, its container is stacked below the next in stacking order. Google Chrome debugger layers tool provides a cool way to visualize layers. Could be better but helps, check it out below. You have to look closely but you can see h...

advice on using react memoization: useMemo, useCallback

I like the "new" react beta docs , lots more info, real helpful info. Well written, good examples, lots of details. Helping me learn & improve. The docs have very helpful guidance for useMemo and when to use use useMemo to cache expensive calculations, don't use for non expensive calculations "In general, unless you’re creating or looping over thousands of objects, it’s probably not expensive" if "time adds up to a significant amount (say, 1ms or more), it might make sense to memoize that calculation" I like the example they show for taking measurements. Why? blanket use of us eMemo (or useCallback) is not harmful but the "code becomes less readable", it also adds to cognitive overhead and does add another function. "Optimizing with useMemo is only valuable in a few cases" the calculation is noticeably slow and dependencies rarely change you should know it's slow before you optimize with useMemo check your dependencies, log ...

laugh: This is a motherf***ing website

https://motherfuckingwebsite.com/ they do a really good job hiding all the complexity 🤣

web components and how we used

Web components "Web Components is a suite of different technologies allowing you to create reusable custom elements — with their functionality encapsulated away from the rest of your code — and utilize them in your web apps." - MDN 3 main technologies Custom elements:  define behavior of the component  Shadow DOM:      a shadow dom is rendered separately from the main document dom, and thus isolated you can create a custom element with a shadow dom  HTLM Templates   write markup templates steps to build your own web component write the class create a js class for your element which inherits from HTMLElement define a constructor with call to super() register it with the CustomElementRegistry object e.g.  customElements.define("word-count", WordCount, { extends: "p" }); the extends is optional, but shows you can extend from existing elements and use like so: <p is="word-count"> terminology update: when extending it called "Custom built i...

Elon, twitter and all that

I don't have a problem with making moves to make your business a success. Cutting failing products. Pivoting. Laying people off. Staying lean. Cutting perks. That's all part of business (especially tech). I and the whole SF office were laid off from a startup in Thanksgiving 2015. Sucked. It happens. We all accepted it and moved on. And I accept that in some cases employees have been overly lavished with perks (although I would like to see how free lunches, laundry etc. compares to executive compensation packages). But how Elon Musk has done it, treating people as disposable and abusable. Forcing people to work round the clock. Ritualistic styled humiliations such  as sign up to be "hardcore" or be fired,   fired if disagree with Elon,  print out your code, send screenshots of your code in an email and come to present.  I don't get how that makes sense?  I mean, all our code is online in github, why print it off and hand deliver? How is someone going to grok tho...

css: vertical-align: middle;

  vertical-align: middle; "The vertical-align CSS property sets vertical alignment of an inline, inline-block or table-cell box." mdn docs nice!