Make js dropdown work properly for sorting mappings