how to remove elements of datepicker in HTML5 input=date that appears on the far right on hovering
Problem :
- How can I remove the caret and incrementor/decrementor that appears when I hover over the matInput
type=date
.
javascript html angular angular-material
add a comment |
Problem :
- How can I remove the caret and incrementor/decrementor that appears when I hover over the matInput
type=date
.
javascript html angular angular-material
add a comment |
Problem :
- How can I remove the caret and incrementor/decrementor that appears when I hover over the matInput
type=date
.
javascript html angular angular-material
Problem :
- How can I remove the caret and incrementor/decrementor that appears when I hover over the matInput
type=date
.
javascript html angular angular-material
javascript html angular angular-material
edited Nov 15 '18 at 10:33
Abhishek Kumar
1,167416
1,167416
asked Nov 15 '18 at 8:15
chaucerchaucer
13
13
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Demo with no hovered increment/decrement icons
Application Code : https://stackblitz.com/edit/angular-incons-hide-input-type-date?file=src/app/app.component.css
Approach :
I looked for the things that are applied on
:hover
of matinput but no luck,
So i tricked by making a mask of white color which will cover that icons using:before
.
This will hide those icons and their actions will not be available like opening of calendar dialog on clicking from icon, as icon is hidden.
Code :
Give class to input tag <input class="myInput" matInput type="date" placeholder="no icons on hover" value="">
,
then add following css
.myInput::before {
content: 'we';
position: absolute;
right: 0;
width: 40px;
height: 40px;
background-color: white;
color: white;
}
actually it is not related to material per se..it appears by default for all html input type=date..so is there a method to make it disappear?
– chaucer
Nov 15 '18 at 8:57
and also i want the datepicker to open when i click on the input field..is there a method for it?
– chaucer
Nov 15 '18 at 8:59
@chaucer yes, its for those where you will give this particular classmyInput
, and according to material there is different date picker for this, they don't use type='date' with matInput. See Datepicker docs : material.angular.io/components/datepicker/overview
– Abhishek Kumar
Nov 15 '18 at 8:59
See this if its helpful, we can't have control over html5 input with type date, stackoverflow.com/questions/18326982/…, i will suggest to use datepicker component from angular.
– Abhishek Kumar
Nov 15 '18 at 9:03
I was looking at my problem wrongly..I am just having
– chaucer
Nov 15 '18 at 9:05
|
show 4 more comments
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315004%2fhow-to-remove-elements-of-datepicker-in-html5-input-date-that-appears-on-the-far%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
Demo with no hovered increment/decrement icons
Application Code : https://stackblitz.com/edit/angular-incons-hide-input-type-date?file=src/app/app.component.css
Approach :
I looked for the things that are applied on
:hover
of matinput but no luck,
So i tricked by making a mask of white color which will cover that icons using:before
.
This will hide those icons and their actions will not be available like opening of calendar dialog on clicking from icon, as icon is hidden.
Code :
Give class to input tag <input class="myInput" matInput type="date" placeholder="no icons on hover" value="">
,
then add following css
.myInput::before {
content: 'we';
position: absolute;
right: 0;
width: 40px;
height: 40px;
background-color: white;
color: white;
}
actually it is not related to material per se..it appears by default for all html input type=date..so is there a method to make it disappear?
– chaucer
Nov 15 '18 at 8:57
and also i want the datepicker to open when i click on the input field..is there a method for it?
– chaucer
Nov 15 '18 at 8:59
@chaucer yes, its for those where you will give this particular classmyInput
, and according to material there is different date picker for this, they don't use type='date' with matInput. See Datepicker docs : material.angular.io/components/datepicker/overview
– Abhishek Kumar
Nov 15 '18 at 8:59
See this if its helpful, we can't have control over html5 input with type date, stackoverflow.com/questions/18326982/…, i will suggest to use datepicker component from angular.
– Abhishek Kumar
Nov 15 '18 at 9:03
I was looking at my problem wrongly..I am just having
– chaucer
Nov 15 '18 at 9:05
|
show 4 more comments
Demo with no hovered increment/decrement icons
Application Code : https://stackblitz.com/edit/angular-incons-hide-input-type-date?file=src/app/app.component.css
Approach :
I looked for the things that are applied on
:hover
of matinput but no luck,
So i tricked by making a mask of white color which will cover that icons using:before
.
This will hide those icons and their actions will not be available like opening of calendar dialog on clicking from icon, as icon is hidden.
Code :
Give class to input tag <input class="myInput" matInput type="date" placeholder="no icons on hover" value="">
,
then add following css
.myInput::before {
content: 'we';
position: absolute;
right: 0;
width: 40px;
height: 40px;
background-color: white;
color: white;
}
actually it is not related to material per se..it appears by default for all html input type=date..so is there a method to make it disappear?
– chaucer
Nov 15 '18 at 8:57
and also i want the datepicker to open when i click on the input field..is there a method for it?
– chaucer
Nov 15 '18 at 8:59
@chaucer yes, its for those where you will give this particular classmyInput
, and according to material there is different date picker for this, they don't use type='date' with matInput. See Datepicker docs : material.angular.io/components/datepicker/overview
– Abhishek Kumar
Nov 15 '18 at 8:59
See this if its helpful, we can't have control over html5 input with type date, stackoverflow.com/questions/18326982/…, i will suggest to use datepicker component from angular.
– Abhishek Kumar
Nov 15 '18 at 9:03
I was looking at my problem wrongly..I am just having
– chaucer
Nov 15 '18 at 9:05
|
show 4 more comments
Demo with no hovered increment/decrement icons
Application Code : https://stackblitz.com/edit/angular-incons-hide-input-type-date?file=src/app/app.component.css
Approach :
I looked for the things that are applied on
:hover
of matinput but no luck,
So i tricked by making a mask of white color which will cover that icons using:before
.
This will hide those icons and their actions will not be available like opening of calendar dialog on clicking from icon, as icon is hidden.
Code :
Give class to input tag <input class="myInput" matInput type="date" placeholder="no icons on hover" value="">
,
then add following css
.myInput::before {
content: 'we';
position: absolute;
right: 0;
width: 40px;
height: 40px;
background-color: white;
color: white;
}
Demo with no hovered increment/decrement icons
Application Code : https://stackblitz.com/edit/angular-incons-hide-input-type-date?file=src/app/app.component.css
Approach :
I looked for the things that are applied on
:hover
of matinput but no luck,
So i tricked by making a mask of white color which will cover that icons using:before
.
This will hide those icons and their actions will not be available like opening of calendar dialog on clicking from icon, as icon is hidden.
Code :
Give class to input tag <input class="myInput" matInput type="date" placeholder="no icons on hover" value="">
,
then add following css
.myInput::before {
content: 'we';
position: absolute;
right: 0;
width: 40px;
height: 40px;
background-color: white;
color: white;
}
edited Nov 19 '18 at 5:48
answered Nov 15 '18 at 8:38
Abhishek KumarAbhishek Kumar
1,167416
1,167416
actually it is not related to material per se..it appears by default for all html input type=date..so is there a method to make it disappear?
– chaucer
Nov 15 '18 at 8:57
and also i want the datepicker to open when i click on the input field..is there a method for it?
– chaucer
Nov 15 '18 at 8:59
@chaucer yes, its for those where you will give this particular classmyInput
, and according to material there is different date picker for this, they don't use type='date' with matInput. See Datepicker docs : material.angular.io/components/datepicker/overview
– Abhishek Kumar
Nov 15 '18 at 8:59
See this if its helpful, we can't have control over html5 input with type date, stackoverflow.com/questions/18326982/…, i will suggest to use datepicker component from angular.
– Abhishek Kumar
Nov 15 '18 at 9:03
I was looking at my problem wrongly..I am just having
– chaucer
Nov 15 '18 at 9:05
|
show 4 more comments
actually it is not related to material per se..it appears by default for all html input type=date..so is there a method to make it disappear?
– chaucer
Nov 15 '18 at 8:57
and also i want the datepicker to open when i click on the input field..is there a method for it?
– chaucer
Nov 15 '18 at 8:59
@chaucer yes, its for those where you will give this particular classmyInput
, and according to material there is different date picker for this, they don't use type='date' with matInput. See Datepicker docs : material.angular.io/components/datepicker/overview
– Abhishek Kumar
Nov 15 '18 at 8:59
See this if its helpful, we can't have control over html5 input with type date, stackoverflow.com/questions/18326982/…, i will suggest to use datepicker component from angular.
– Abhishek Kumar
Nov 15 '18 at 9:03
I was looking at my problem wrongly..I am just having
– chaucer
Nov 15 '18 at 9:05
actually it is not related to material per se..it appears by default for all html input type=date..so is there a method to make it disappear?
– chaucer
Nov 15 '18 at 8:57
actually it is not related to material per se..it appears by default for all html input type=date..so is there a method to make it disappear?
– chaucer
Nov 15 '18 at 8:57
and also i want the datepicker to open when i click on the input field..is there a method for it?
– chaucer
Nov 15 '18 at 8:59
and also i want the datepicker to open when i click on the input field..is there a method for it?
– chaucer
Nov 15 '18 at 8:59
@chaucer yes, its for those where you will give this particular class
myInput
, and according to material there is different date picker for this, they don't use type='date' with matInput. See Datepicker docs : material.angular.io/components/datepicker/overview– Abhishek Kumar
Nov 15 '18 at 8:59
@chaucer yes, its for those where you will give this particular class
myInput
, and according to material there is different date picker for this, they don't use type='date' with matInput. See Datepicker docs : material.angular.io/components/datepicker/overview– Abhishek Kumar
Nov 15 '18 at 8:59
See this if its helpful, we can't have control over html5 input with type date, stackoverflow.com/questions/18326982/…, i will suggest to use datepicker component from angular.
– Abhishek Kumar
Nov 15 '18 at 9:03
See this if its helpful, we can't have control over html5 input with type date, stackoverflow.com/questions/18326982/…, i will suggest to use datepicker component from angular.
– Abhishek Kumar
Nov 15 '18 at 9:03
I was looking at my problem wrongly..I am just having
– chaucer
Nov 15 '18 at 9:05
I was looking at my problem wrongly..I am just having
– chaucer
Nov 15 '18 at 9:05
|
show 4 more comments
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315004%2fhow-to-remove-elements-of-datepicker-in-html5-input-date-that-appears-on-the-far%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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