showing html in the browser but not the textbox












0















update1: updated image for better understanding



enter image description here



I am trying to implement chip filters similar to googleflights. Right now when you select sports it will show sports1 it will replace sports by sports1.



However, I wanted to insert a textbox, when I enter somevalue in the textbox and hit Enter the primary fee schedule value should change to the entered value.



Can you tell me how to fix it?



chip related code is in chip-selector and tab-demo
since if I enter textbox tag. I am just getting string



code snippet and sandbox



const primaryFeeMenuItems = [
"primaryFeeMenuItems1",
"<input type="text" name="fname">",
"primaryFeeMenuItems2",
"primaryFeeMenuItems3"
];

<td>
<SimpleMenu
buttonName="Primary Fee Schedule"
menuItems={primaryFeeMenuItems}
/>
</td>
handleDelete() {
this.setState({ display: !this.state.display });
}

handleClick = event => {
console.log("handle Click");
this.setState({ anchorEl: event.currentTarget });
};

handleClose = e => {
console.log(e.menuItem);
if (e.menuItem) {
this.setState({ display: !this.state.display });
this.setState({ chipName: e.menuItem });
}
this.setState({ anchorEl: null });
};









share|improve this question

























  • Hey I tried and posted...can you please help...can you guys let me know how to remove negative marks

    – inji inji
    Nov 8 '18 at 20:29











  • Not sure what you are trying to achieve here.

    – Sujil Maharjan
    Nov 10 '18 at 20:36











  • @SujilMaharjan hey thanks for your reply...I have updated the image where it shows chips menu...I am trying to achieve similar to that

    – inji inji
    Nov 13 '18 at 14:21
















0















update1: updated image for better understanding



enter image description here



I am trying to implement chip filters similar to googleflights. Right now when you select sports it will show sports1 it will replace sports by sports1.



However, I wanted to insert a textbox, when I enter somevalue in the textbox and hit Enter the primary fee schedule value should change to the entered value.



Can you tell me how to fix it?



chip related code is in chip-selector and tab-demo
since if I enter textbox tag. I am just getting string



code snippet and sandbox



const primaryFeeMenuItems = [
"primaryFeeMenuItems1",
"<input type="text" name="fname">",
"primaryFeeMenuItems2",
"primaryFeeMenuItems3"
];

<td>
<SimpleMenu
buttonName="Primary Fee Schedule"
menuItems={primaryFeeMenuItems}
/>
</td>
handleDelete() {
this.setState({ display: !this.state.display });
}

handleClick = event => {
console.log("handle Click");
this.setState({ anchorEl: event.currentTarget });
};

handleClose = e => {
console.log(e.menuItem);
if (e.menuItem) {
this.setState({ display: !this.state.display });
this.setState({ chipName: e.menuItem });
}
this.setState({ anchorEl: null });
};









share|improve this question

























  • Hey I tried and posted...can you please help...can you guys let me know how to remove negative marks

    – inji inji
    Nov 8 '18 at 20:29











  • Not sure what you are trying to achieve here.

    – Sujil Maharjan
    Nov 10 '18 at 20:36











  • @SujilMaharjan hey thanks for your reply...I have updated the image where it shows chips menu...I am trying to achieve similar to that

    – inji inji
    Nov 13 '18 at 14:21














0












0








0








update1: updated image for better understanding



enter image description here



I am trying to implement chip filters similar to googleflights. Right now when you select sports it will show sports1 it will replace sports by sports1.



However, I wanted to insert a textbox, when I enter somevalue in the textbox and hit Enter the primary fee schedule value should change to the entered value.



Can you tell me how to fix it?



chip related code is in chip-selector and tab-demo
since if I enter textbox tag. I am just getting string



code snippet and sandbox



const primaryFeeMenuItems = [
"primaryFeeMenuItems1",
"<input type="text" name="fname">",
"primaryFeeMenuItems2",
"primaryFeeMenuItems3"
];

<td>
<SimpleMenu
buttonName="Primary Fee Schedule"
menuItems={primaryFeeMenuItems}
/>
</td>
handleDelete() {
this.setState({ display: !this.state.display });
}

handleClick = event => {
console.log("handle Click");
this.setState({ anchorEl: event.currentTarget });
};

handleClose = e => {
console.log(e.menuItem);
if (e.menuItem) {
this.setState({ display: !this.state.display });
this.setState({ chipName: e.menuItem });
}
this.setState({ anchorEl: null });
};









share|improve this question
















update1: updated image for better understanding



enter image description here



I am trying to implement chip filters similar to googleflights. Right now when you select sports it will show sports1 it will replace sports by sports1.



However, I wanted to insert a textbox, when I enter somevalue in the textbox and hit Enter the primary fee schedule value should change to the entered value.



Can you tell me how to fix it?



chip related code is in chip-selector and tab-demo
since if I enter textbox tag. I am just getting string



code snippet and sandbox



const primaryFeeMenuItems = [
"primaryFeeMenuItems1",
"<input type="text" name="fname">",
"primaryFeeMenuItems2",
"primaryFeeMenuItems3"
];

<td>
<SimpleMenu
buttonName="Primary Fee Schedule"
menuItems={primaryFeeMenuItems}
/>
</td>
handleDelete() {
this.setState({ display: !this.state.display });
}

handleClick = event => {
console.log("handle Click");
this.setState({ anchorEl: event.currentTarget });
};

handleClose = e => {
console.log(e.menuItem);
if (e.menuItem) {
this.setState({ display: !this.state.display });
this.setState({ chipName: e.menuItem });
}
this.setState({ anchorEl: null });
};






javascript html reactjs redux material-ui






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 14:19







inji inji

















asked Nov 8 '18 at 19:49









inji injiinji inji

6810




6810













  • Hey I tried and posted...can you please help...can you guys let me know how to remove negative marks

    – inji inji
    Nov 8 '18 at 20:29











  • Not sure what you are trying to achieve here.

    – Sujil Maharjan
    Nov 10 '18 at 20:36











  • @SujilMaharjan hey thanks for your reply...I have updated the image where it shows chips menu...I am trying to achieve similar to that

    – inji inji
    Nov 13 '18 at 14:21



















  • Hey I tried and posted...can you please help...can you guys let me know how to remove negative marks

    – inji inji
    Nov 8 '18 at 20:29











  • Not sure what you are trying to achieve here.

    – Sujil Maharjan
    Nov 10 '18 at 20:36











  • @SujilMaharjan hey thanks for your reply...I have updated the image where it shows chips menu...I am trying to achieve similar to that

    – inji inji
    Nov 13 '18 at 14:21

















Hey I tried and posted...can you please help...can you guys let me know how to remove negative marks

– inji inji
Nov 8 '18 at 20:29





Hey I tried and posted...can you please help...can you guys let me know how to remove negative marks

– inji inji
Nov 8 '18 at 20:29













Not sure what you are trying to achieve here.

– Sujil Maharjan
Nov 10 '18 at 20:36





Not sure what you are trying to achieve here.

– Sujil Maharjan
Nov 10 '18 at 20:36













@SujilMaharjan hey thanks for your reply...I have updated the image where it shows chips menu...I am trying to achieve similar to that

– inji inji
Nov 13 '18 at 14:21





@SujilMaharjan hey thanks for your reply...I have updated the image where it shows chips menu...I am trying to achieve similar to that

– inji inji
Nov 13 '18 at 14:21












1 Answer
1






active

oldest

votes


















1














You are using Menu which works a little differently than what you are trying to achieve. Actually looking into how Google Flights is using these filters, it seems like they are using Chips and Dialog components to produce that result. Once you use a Dialog component, you can define the content yourself.



I have created a sandbox here



I converted your code to take Dialog instead of Menu.



<div>
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
className={this.props.classes.chip}
color="primary"
/>

<Button
style={{ display: this.state.display ? "none" : "" }}
aria-owns={anchorEl ? "simple-menu" : undefined}
aria-haspopup="true"
onClick={this.handleClick}
>
{this.props.buttonName}
</Button>

<Dialog
onClose={this.handleClose}
aria-labelledby="simple-dialog-title"
open={this.state.openDialog}
>
<DialogTitle id="simple-dialog-title" style={titleStyle}>
Set backup account
</DialogTitle>
<div>
<input type="text" placeHolder="type here" />
<List>{menuItems}</List>
</div>
</Dialog>
</div>


menuItems returns ListItem instead of MenuItems. Find the full code in the sandbox.



The input you are trying to get should be before the List. You can handle that any way you want.



I haven't overridden the CSS properties for Dialog. So, once you override the backdrop background color and position of the dialog, you should achieve the display as well.






share|improve this answer
























  • can you help me with this one --> stackoverflow.com/questions/53232921/…

    – inji inji
    Nov 13 '18 at 16:22











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53215128%2fshowing-html-in-the-browser-but-not-the-textbox%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You are using Menu which works a little differently than what you are trying to achieve. Actually looking into how Google Flights is using these filters, it seems like they are using Chips and Dialog components to produce that result. Once you use a Dialog component, you can define the content yourself.



I have created a sandbox here



I converted your code to take Dialog instead of Menu.



<div>
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
className={this.props.classes.chip}
color="primary"
/>

<Button
style={{ display: this.state.display ? "none" : "" }}
aria-owns={anchorEl ? "simple-menu" : undefined}
aria-haspopup="true"
onClick={this.handleClick}
>
{this.props.buttonName}
</Button>

<Dialog
onClose={this.handleClose}
aria-labelledby="simple-dialog-title"
open={this.state.openDialog}
>
<DialogTitle id="simple-dialog-title" style={titleStyle}>
Set backup account
</DialogTitle>
<div>
<input type="text" placeHolder="type here" />
<List>{menuItems}</List>
</div>
</Dialog>
</div>


menuItems returns ListItem instead of MenuItems. Find the full code in the sandbox.



The input you are trying to get should be before the List. You can handle that any way you want.



I haven't overridden the CSS properties for Dialog. So, once you override the backdrop background color and position of the dialog, you should achieve the display as well.






share|improve this answer
























  • can you help me with this one --> stackoverflow.com/questions/53232921/…

    – inji inji
    Nov 13 '18 at 16:22
















1














You are using Menu which works a little differently than what you are trying to achieve. Actually looking into how Google Flights is using these filters, it seems like they are using Chips and Dialog components to produce that result. Once you use a Dialog component, you can define the content yourself.



I have created a sandbox here



I converted your code to take Dialog instead of Menu.



<div>
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
className={this.props.classes.chip}
color="primary"
/>

<Button
style={{ display: this.state.display ? "none" : "" }}
aria-owns={anchorEl ? "simple-menu" : undefined}
aria-haspopup="true"
onClick={this.handleClick}
>
{this.props.buttonName}
</Button>

<Dialog
onClose={this.handleClose}
aria-labelledby="simple-dialog-title"
open={this.state.openDialog}
>
<DialogTitle id="simple-dialog-title" style={titleStyle}>
Set backup account
</DialogTitle>
<div>
<input type="text" placeHolder="type here" />
<List>{menuItems}</List>
</div>
</Dialog>
</div>


menuItems returns ListItem instead of MenuItems. Find the full code in the sandbox.



The input you are trying to get should be before the List. You can handle that any way you want.



I haven't overridden the CSS properties for Dialog. So, once you override the backdrop background color and position of the dialog, you should achieve the display as well.






share|improve this answer
























  • can you help me with this one --> stackoverflow.com/questions/53232921/…

    – inji inji
    Nov 13 '18 at 16:22














1












1








1







You are using Menu which works a little differently than what you are trying to achieve. Actually looking into how Google Flights is using these filters, it seems like they are using Chips and Dialog components to produce that result. Once you use a Dialog component, you can define the content yourself.



I have created a sandbox here



I converted your code to take Dialog instead of Menu.



<div>
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
className={this.props.classes.chip}
color="primary"
/>

<Button
style={{ display: this.state.display ? "none" : "" }}
aria-owns={anchorEl ? "simple-menu" : undefined}
aria-haspopup="true"
onClick={this.handleClick}
>
{this.props.buttonName}
</Button>

<Dialog
onClose={this.handleClose}
aria-labelledby="simple-dialog-title"
open={this.state.openDialog}
>
<DialogTitle id="simple-dialog-title" style={titleStyle}>
Set backup account
</DialogTitle>
<div>
<input type="text" placeHolder="type here" />
<List>{menuItems}</List>
</div>
</Dialog>
</div>


menuItems returns ListItem instead of MenuItems. Find the full code in the sandbox.



The input you are trying to get should be before the List. You can handle that any way you want.



I haven't overridden the CSS properties for Dialog. So, once you override the backdrop background color and position of the dialog, you should achieve the display as well.






share|improve this answer













You are using Menu which works a little differently than what you are trying to achieve. Actually looking into how Google Flights is using these filters, it seems like they are using Chips and Dialog components to produce that result. Once you use a Dialog component, you can define the content yourself.



I have created a sandbox here



I converted your code to take Dialog instead of Menu.



<div>
<Chip
style={{ display: this.state.display ? "" : "none" }}
label={this.state.chipName}
onDelete={this.handleDelete}
className={this.props.classes.chip}
color="primary"
/>

<Button
style={{ display: this.state.display ? "none" : "" }}
aria-owns={anchorEl ? "simple-menu" : undefined}
aria-haspopup="true"
onClick={this.handleClick}
>
{this.props.buttonName}
</Button>

<Dialog
onClose={this.handleClose}
aria-labelledby="simple-dialog-title"
open={this.state.openDialog}
>
<DialogTitle id="simple-dialog-title" style={titleStyle}>
Set backup account
</DialogTitle>
<div>
<input type="text" placeHolder="type here" />
<List>{menuItems}</List>
</div>
</Dialog>
</div>


menuItems returns ListItem instead of MenuItems. Find the full code in the sandbox.



The input you are trying to get should be before the List. You can handle that any way you want.



I haven't overridden the CSS properties for Dialog. So, once you override the backdrop background color and position of the dialog, you should achieve the display as well.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 13 '18 at 15:52









Sujil MaharjanSujil Maharjan

44738




44738













  • can you help me with this one --> stackoverflow.com/questions/53232921/…

    – inji inji
    Nov 13 '18 at 16:22



















  • can you help me with this one --> stackoverflow.com/questions/53232921/…

    – inji inji
    Nov 13 '18 at 16:22

















can you help me with this one --> stackoverflow.com/questions/53232921/…

– inji inji
Nov 13 '18 at 16:22





can you help me with this one --> stackoverflow.com/questions/53232921/…

– inji inji
Nov 13 '18 at 16:22


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53215128%2fshowing-html-in-the-browser-but-not-the-textbox%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine