mirror of
				https://gitlab.nic.cz/turris/reforis/foris-js.git
				synced 2025-11-03 23:00:31 +01:00 
			
		
		
		
	Add Natural sort order for list of options
This commit is contained in:
		@@ -28,10 +28,11 @@ export function Select({
 | 
			
		||||
}) {
 | 
			
		||||
    const uid = useUID();
 | 
			
		||||
 | 
			
		||||
    const options = Object.keys(choices).map(
 | 
			
		||||
    const options = Object.keys(choices).sort(
 | 
			
		||||
        (a, b) => a - b || a.toString().localeCompare(b.toString()),
 | 
			
		||||
    ).map(
 | 
			
		||||
        (key) => <option key={key} value={key}>{choices[key]}</option>,
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
        <div className="form-group">
 | 
			
		||||
            <label htmlFor={uid}>{label}</label>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user