cvc-complex-type.2.4.d: Invalid content was found starting with element 'required'. No child element is expected at this point - required

When I am enabling the required elements in dictionary.tld I am getting the error
Multiple annotations found at this line:
- cvc-complex-type.2.4.d: Invalid content was found starting with element 'required'. No child element is expected at this point.
Is there any way to resolve this?

Related

Is it possible to bind properties to spans?

I created a Blazor fiddle for easier understanding.
On the left hand side, you see, what I have: There is an <input>, two <span>s that display values that depend on the <input> and a third <span> that displays the sum. The <span>s are editable but when I edit the values, the sum is not updated.
In the middle, you see, what I want: I changed two <span>s to <textarea>s and bound their contents to the properties Number3 and Number4. This enables me to have an updated sum not only when the <input> is changed but also when I enter a number in one of the <textarea>s.
These bindings work well with <textarea>s but not with <span>s. But I'd like to use <span>s, because no formatting is necessary (e. g. width and height) and depending on other conditions, the content should be editable or not. I realized this with contenteditable="#(UserIsLoggedIn ? "true" : "false")".
On the right hand side, I tried <span>s but a simple #bind="Number5" produces an error during run time because it is interpreted as attribute and the error is
Failed to execute 'setAttribute' on 'Element': '#bind' is not a valid attribute name.
So I tried #bind-value="Number5" #bind-value:event="oninput" but this only creates an attribute named value. In the dev tools I see, there is a <span value="2"></span> with size 0x0, because it is empty.
Is it possible to bind properties to <span>s just like I bound them to the <textarea>s? If not, can I make a textarea look like and behave (contenteditable="false") like a span?

RSelenium: Click on the nth iteration of a class in a nested div

I'm trying to click on the 4th iteration of a svg of class "MuiSvgIcon-root.MuiSvgIcon-fontSizeMedium.css-10dohqv". You can see from the search bar at the bottom that this is the 4th of 16 times this class type appears in the code.
I figure this code should work:
logout <- remDr$findElement(using="css selector", value="svg.MuiSvgIcon-root.MuiSvgIcon-fontSizeMedium.css-10dohqv > :nth-of-type(4)")
logout$clickElement()
However, it's selecting a different element (the 5th). Further, R seems to think that this is the last element of this class type. If I use nth-of-type(5), I get the following error message Selenium message:Unable to locate element.
Any idea why this is happening or how to click on this element? Is the problem related to the existence of <div role="button" tabindex="0" class>?
I was able to click the button using findElements (plural) to get a list of the number of times this element occurred in the code, and then I selected the 5th element on the list. Note that I'm using a different css element (the list was shorter so it was just easier).
logout <- remDr$findElements(using="css", value="button.MuiButtonBase-root._1rIDE.MuiIconButton-root.MuiIconButton-sizeMedium._1mHFW.css-1yxmbwk")
logout[[5]]$clickElement()
I'm dissatisfied with this because I don't understand why nth doesn't work. I also don't understand why this was the 5th element (under "Inspect", if I use control+F, this element only appears 4 times). But, this does work.

NextjS Image issue with src and default external image URL

I am using the latest version of NextJS 10.0.9. I've got an Image that I'm trying to display, however I'm receiving the error:
Error: Image with src "https://picsum.photos/480/270" must use "width" and "height" properties or "layout='fill'" property.
As you can see here though, I do have all of those properties set:
<div className="card-img">
<Image
alt={media?.title}
title={media?.title}
src={media?.previewImage || 'https://picsum.photos/480/270'}
width={480}
height={270}
layout="fill"
/>
</div>
For some reason, it appears that having a default external image doesn't want to play nicely with the Image component. Does anyone know a workaround or reason why this might be the case?
A little side note too: I've got a Typescript error on the layout property that says "Type '"fill"' is not assignable to type '"fixed" | "intrinsic" | "responsive" | undefined'.". I'm not sure if that's related?
If you use layout='fill', you do not need a width and height attribute. The error message isn't completely clear, but that "or" is an exclusive or. You can define the width/height or layout='fill', but not both.
This is a byproduct of how next/image works: the width/height props are used to determine aspect ratio, not necessarily display size.
Since layout='fill' means "stretch to fill the parent element", the width and height are meaningless. So to fix the error, either remove layout='fill', or remove the dimensions.
You've probably already seen this, but here are the docs just in case: https://nextjs.org/docs/api-reference/next/image
For others who may have come across this page but not quite found the answer that they are looking for I would also like to highlight that the width and height props of the Next 'Image' component do not accept decimals. This is quite easy to overlook as the error message does not make any reference to prop format.

Why do I get a different offsetHeight value within ngOnChanges?

Example plunker:
http://plnkr.co/edit/YLLslImGOpS8u6zx
In the plunker, I display the height and width of a div from the parent component using ViewChild.
I pass the div from the parent component to the child component as an Input HTMLElement, and in the child component, I again read the currentValue of this input. If you open the browser console, I logged the SimpleChanges object. If you look at the currentValue.offsetHeight, the height is the expected value (i.e. the value matches what the parent component is displaying)
However, the child component is displaying a different value from the expected.
Whats even stranger is if you edit the child component template to something like:
<div>
<p>Child: {{ display }}</p>
</div>
Simply adding some additional content in the div, the child component now displays the expected value (i.e. the value matches what the parent component is displaying, and it matches the value in SimpleChanges)
To put it simply, why does this difference occur?
In my code-base, I'm experiencing an issue using offsetHeight where the value within SimpleChanges is accurate, but the value I try to store on an instance variable and use within the component is inaccurate. This plunker probably does not emulate exactly the issue I face in my code-base but maybe understanding the cause/effects of what I described above might help me figure out the problem I face in my code-base.
Thanks!

getComputedStyle returns a CSSStyleDeclaration but all properties are empty on access

I have a simple div that uses a css class which in turn has a color and background-color property set.
var div = document.createElement("div");
div.classList.add("my-css-class");
container.appendChild(div);
//This prints out a CSSStyleDeclaration object. This is a large object to which I see `color` and `backgroundColor`
console.log(getComputedStyle(div));
//this gives me an empty string
console.log(getComputedStyle(div).color);
//this gives me an empty string
console.log(getComputedStyle(div).getPropertyValue("color"));
Why am I unable to access the properties of the CSSStyleDeclaration? I know it is there from my first log. I can see color: "rgb(82, 194, 145)"
Ultimately the problem with getComputedStyle is that it appears that the element in question must be a part of the DOMTree in order for any style to be available.
Notice in my case, I was adding the div to the parent container, however, the parent container at the point of instantiation is not yet added to the DOMTree.
My failure to use JSON.stringify() to print the object meant that values were appearing later but at the time of access, were blank.
So basically, I changed my container.appendChild to document.body.appendChild temporarily to compute the style I need straight away, and then remove it and destroy it leaving me just the colors I needed.

Resources