Auto-focus case/unit field when showing inventory count page
This commit is contained in:
		
							parent
							
								
									8c6fe828ad
								
							
						
					
					
						commit
						a1bf81aa56
					
				
					 1 changed files with 13 additions and 1 deletions
				
			
		|  | @ -44,13 +44,15 @@ | ||||||
|         <b-input v-model="row.cases" |         <b-input v-model="row.cases" | ||||||
|                  type="number" |                  type="number" | ||||||
|                  step="any" |                  step="any" | ||||||
|  |                  ref="cases" | ||||||
|                  :disabled="!shouldAllowCases()"> |                  :disabled="!shouldAllowCases()"> | ||||||
|         </b-input> |         </b-input> | ||||||
|       </b-field> |       </b-field> | ||||||
|       <b-field label="Units" expanded> |       <b-field label="Units" expanded> | ||||||
|         <b-input v-model="row.units" |         <b-input v-model="row.units" | ||||||
|                  type="number" |                  type="number" | ||||||
|                  step="any"> |                  step="any" | ||||||
|  |                  ref="units"> | ||||||
|         </b-input> |         </b-input> | ||||||
|       </b-field> |       </b-field> | ||||||
|     </b-field> |     </b-field> | ||||||
|  | @ -100,6 +102,16 @@ export default { | ||||||
|         this.fetch(this.$route.params.uuid) |         this.fetch(this.$route.params.uuid) | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|  |     updated() { | ||||||
|  |         this.$nextTick(() => { | ||||||
|  |             if (this.shouldAllowCases()) { | ||||||
|  |                 this.$refs.cases.focus() | ||||||
|  |             } else { | ||||||
|  |                 this.$refs.units.focus() | ||||||
|  |             } | ||||||
|  |         }) | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|     methods: { |     methods: { | ||||||
| 
 | 
 | ||||||
|         getIndexUrl() { |         getIndexUrl() { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar