check if in document before emptying selector
create dom first
add in createDom to help migration from layoutmanager