Custom component like DateField


I’m trying to implement a custom component which looks like a DateField. I’m extending CustomComponent and it contains a TextField and a PopupButton. I have managed to create style which creates one border around textfield and button, but the problem is now focused border: How to create style when user clicks the textfield, then the focused border is around field and button and when user clicks the popupbutton then focused border is again around both components?



Make up separate stylenames for those states and toggle them in click-/focus-/blurlisteners? Just remember that you need to remove them when clicked somewhere completely outside.