0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-25 14:02:40 +00:00

Merge branch 'Functional-Tag-Editor' into Func-Tag-Editor-Features

This commit is contained in:
Gazook89
2024-09-19 14:54:28 -05:00
2 changed files with 7 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
require('./tagInput.less');
const React = require('react');
const { useState, useEffect } = React;
const _ = require('lodash');
@@ -57,13 +58,13 @@ const TagInput = ({ unique = true, values = [], ...props }) => {
const renderReadTag = (context, index) => {
return (
<div key={index}
<li key={index}
data-value={context.value}
className='tag'
onClick={() => editTag(context.value)}>
{context.value}
<button onClick={(evt)=>{evt.stopPropagation(); submitTag(null, context.value, index)}}><i className='fa fa-times fa-fw'/></button>
</div>
</li>
);
};
@@ -81,8 +82,10 @@ const TagInput = ({ unique = true, values = [], ...props }) => {
return (
<div className='field'>
<label>{props.label}</label>
<div className='list'>
{valueContext.map((context, index) => { return context.editing ? renderWriteTag(context, index) : renderReadTag(context, index); })}
<div className='tag-input'>
<ul className='list'>
{valueContext.map((context, index) => { return context.editing ? renderWriteTag(context, index) : renderReadTag(context, index); })}
</ul>
<input type='text'
className='value'