3 ms·
I had to replicate the SharePoint people picker: "resolved" values are styled and are removed as a whole with a single backspace/delete. SP was doing something
by zamalek 5y ago
I had to replicate the SharePoint people picker: "resolved" values are styled and are removed as a whole with a single backspace/delete. SP was doing something super neat: it used ::after and content with an empty tag. A pretty neat trick, if you don't need to embed HTML (as content only supports plain text).
The bulk of my time was spent removing text formatting on paste, and Safari bugs.
- dbbk 5y agoI believe you can also achieve this by setting contenteditable="off" on an inline element to make the whole thing removable with backspace.